Open TheCodeTherapy opened 3 years ago
I have two displays (laptop screen + external monitor) and I cannot get MAME to show up on anything but the laptop screen, no matter what arguments I pass or what configuration I have in mame.ini - I am also using Pop OS
I'm on Ubuntu 20.04 running MAME 0.258 installed via flatpak. I also cannot for the life of me get MAME to come up on my primary monitor in fullscreen. I've tried all the -screen settings, both at the command line and the mame.ini file. None of these make any difference.
One aside here. I can launch MAME and then move it to my primary monitor with GNOME's help. If I press alt+space and then select "move to monitor right" it will move there. But then switching away from it with alt+tab causes it to minimize and then come back up on my secondary monitor when I unminimize it.
I managed to find a fix that works for me. But it involves modifying the source.
Lines 595 and 596 of src/osd/sdl/window.cpp are:
595: m_extra_flags |= (fullscreen() ?
596: SDL_WINDOW_BORDERLESS | SDL_WINDOW_INPUT_FOCUS | SDL_WINDOW_FULLSCREEN : SDL_WINDOW_RESIZABLE);
I found that removing the SDL_WINDOW_BORDERLESS flag seems to completely correct the problem.
I'll mention this as well. The monitor I have marked as primary through my OS is HDMI-1. My secondary monitor is HDMI-0. That's how xranr describes them. I think this issue might only affect people who have a setup similar to mine. The monitor they're using as their primary is not their first monitor physically. People who are running MAME on laptops with an external display as their primary and the built-in laptop monitor as their secondary for example.
So, this might be a bug in SDL2, or maybe the particular version of SDL2 that's shipping with Ubuntu 20.04.6. I tested this further by creating a simple test program that creates a fullscreen window using SDL2. I can reproduce this behavior there as well. Any combination of flags I tried that included SDL_WINDOW_BORDERLESS caused the window to come up on my second monitor.
I proposed a change: https://github.com/mamedev/mame/compare/master...Davidian1024:mame:patch-1
As of 0.259 this is fixed for me on Ubuntu 20.04.
MAME 0.226, compiled from source on PopOS 20.04 (Ubuntu-based distro). This is somehow related to #7309 but it doesn't work properly.
The setup used to reproduce is a triple-monitor setup, with 3 monitors connected by DisplayPort.
I tried the suggested command line parameters provided on #7309 however: -screen screen0 makes MAME appear on my right monitor -screen screen1 does the same (MAME appears on right monitor) -screen screen2 makes MAME appear on my left monitor
All other possible screenX provided make MAME appear on the right monitor, and so far I couldn't find a way for it to appear on my center monitor (which is the primary display on my distro configuration).
Worth mentioning that the issue only occurs on Gnome (on KDE Plasma, maybe due to differences in how KDE Plasma manages composition or display management, the issue does not occur, and MAME always appears on the primary display).
Worth mentioning as well that there's no information on MAME docs on how the OSD PER-WINDOW VIDEO OPTIONS should be configured on Linux machines. The docs only mention the \.\DISPLAYn, which is a Windows-only notation.
Important note: If I change my primary display to be the display on the left on my Linux configuration, then the following command makes MAME show up on my center screen:
mame64 -screen screen0
... that said, I presume there's some sort of conflict for MAME to run on the primary display, or maybe I'm providing the wrong config on my mame.ini
OSD PER-WINDOW VIDEO OPTIONS on mame.ini
mame64 -verbose:
xrandr | grep ' connected':
The bug was identified trying to make MAME show on DP-4, which is my primary display.
....