SDL
SDL copied to clipboard
Fullscreen bug
Describe the bug The user interfaces for Widelands and Supertux (and probably other SDL applications) glitch slightly where the coordinates to click became displaced from what the visual screen looks like, both during gameplay as well as at the menu screen, in the following condition:
To Reproduce Steps to reproduce the behavior:
- Use i3 window manager [ https://i3wm.org/ ] and in a workspace screen where other windows are tiled (e.g. above or below Widelands/Supertux), and Widelands/Supertux in window mode (without CTRL+F keyboard shortcut enabling fullscreen in Widelands, or Options -> Fullscreen in Supertux)
- Push CTRL+F to turn on/enable Widelands native fullscreen mode, or Options -> Fullscreen in Supertux (otherwise there is no issue)
- Push i3wm keybinding Mod1+f to toggle i3's fullscreen mode. (this should undo Widelands/Supertux fullscreen to revert back into a window)
- Move the cursor around to see coordinate glitches
Expected behavior Window manager toggling of fullscreen should be detected by Widelands/Supertux.
Also see https://github.com/widelands/widelands/issues/5523 where the issue was first reported, and directed to report here.
I was searching to see if this has been reported already, because it probably has, and I found these possibly related issues:
- https://github.com/libsdl-org/SDL/issues/6056
- https://github.com/libsdl-org/SDL/issues/6050
- https://github.com/libsdl-org/SDL/issues/5593
- https://github.com/libsdl-org/SDL/issues/5925
- https://github.com/libsdl-org/SDL/pull/5537
- https://github.com/libsdl-org/SDL/issues/5390
On this topic, the Wayland backend never really properly handled going into and out of fullscreen via the desktop hot key. I've been working on fixing it and will have a patch soon. It's a bit of work as the way it's handled needs some plumbing outside of the Wayland backend to fully accommodate it, and I'm trying to find the least invasive way to do it.
i3 is x11, and I'm not very familiar with the x11 backend, so I can't comment on that.
This bug seems to have been fixed in 2.24.0. However, exiting fullscreen with mod+f doesn't seem to remove the fullscreen window flag and I have to press the fullscreen shortcut twice to go back into fullscreen.
This can lose the Wayland tag as I mentioned it due to the backend having a similiar issue at the time, however support for fullscreen toggling from compositor events is now properly handled, so this is strictly an X11 issue.
so this is strictly an X11 issue.
This is something we fought with, and gave up on, in #5390. If this works for Wayland that's great, but it's a lost cause in the universe of incompatible X11 window managers.
If all that remains is that the X11 backend doesn't update SDL_WINDOW_FULLSCREEN* correctly when the window manager fullscreens something itself, this can be closed.
@icculus I may have redirected this issue into the wrong project stream where the issue lies. I thought maybe the i3 window manager is the code base that is responsible, but in the reply, to the issue linked above, it seems that i3 code base is not relevant. Do you know which X11 project repository is where the issue is originating from? I tried checking to see what X11-related things I have installed in my Archlinux environment to maybe figure out where the relevant repository is and maybe it would be https://xorg.freedesktop.org/ or something that is not on GitHub? I'll try to figure out maybe, in case the developers are not aware that there is an issue, and to connect the dot to here, but if you or anyone knows where to relay to, it would be appreciated.