-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SDL3, X11] fullscreen transitions cause displays to behave as though disconnected; fullscreen flag not set correctly #9560
Comments
In the case of the incorrect window flags, the sync function just needs to allow for extra time if a mode switch is in progress. I'll fix that up tomorrow. As for everything exploding when switching modes on multi-monitor setups, I'll have to ping @icculus for help on that. I've never touched the XRandR code, and, honestly, I don't think I've ever had X11 work correctly when switching modes on anything but the primary display, and even then, occasionally the other displays would just disappear and need to be re-enabled, or end up in a weird state. To be fair, the X11 mode switching code does say:
|
The incorrect flags should be fixed now. |
Fullscreen flag looks fixed on my end as well. Thank you very much for taking care of it so quickly, I appreciate it. |
I looked into the mode switching issue, and, unless someone can point out something specific that SDL is doing wrong, I don't think there is anything to be done here. Anything that does mode switching, be it SDL, GLFW, WINE, etc… seems to randomly leave my multi-display setup in a broken state, particularly when switching the mode on a non-primary display. Sometimes the display won't switch back, sometimes a display will behave as if disconnected until entering the settings and re-enabling it, sometimes there are weird scrolling issues, and so on. It's likely just a case of X mode switching being a janky pile of excrement in general. |
Switching a window to exclusive fullscreen mode and back to windowed mode sometimes leads to various misbehaviour.
I am using Ubuntu 22.04.4 LTS, and SDL 3.1.1 with the X11 video driver. My setup is two displays in "join displays" mode. Display A is set to 1920 x 1080 @ 60.0 Hz; display B is set to 3840 x 2160 @ 60.0 Hz.
I expect that:
SDL_SyncWindow()
,SDL_GetWindowFlags()
will report that theSDL_WINDOW_FULLSCREEN
bit is set;SDL_GetWindowFlags()
will report that theSDL_WINDOW_FULLSCREEN
bit is not set.If only one display is connected, and the desktop display mode differs from the fullscreen display mode, transitions between fullscreen and windowed mode work correctly, but
SDL_GetWindowFlags()
reports that theSDL_WINDOW_FULLSCREEN
bit is 0 in fullscreen mode, and 1 in windowed mode -- the opposite of what I expect.If both displays are connected and a resolution change is necessary, things really fall apart. In addition to the
SDL_WINDOW_FULLSCREEN
bit being set incorrectly, displays disconnect (indicate "no signal," fall asleep) during fullscreen transitions. The secondary display sometimes disconnects during the transition to fullscreen, and both displays always disconnect during the transition back to windowed mode. Both displays continue to behave as though disconnected indefinitely; waiting for the program to terminate and restarting the GNOME shell with the keyboard returns the displays to normal. Additionally, the program prints one or both of the following messages, sometimes repeatedly:My test program behaves entirely as expected if only one display is connected, and the desktop display mode is the same as the fullscreen display mode.
Other applications I have tested do not exhibit problems with fullscreen transitions. I also wrote a similar test program using GLFW; it does not restore the desktop display mode upon exiting fullscreen, but otherwise behaves correctly. It therefore seems plausible that the issue is either with my program, or with SDL3.
My SDL test program is as follows:
My GLFW test program is as follows:
The text was updated successfully, but these errors were encountered: