SDL icon indicating copy to clipboard operation
SDL copied to clipboard

Mode changes not working in XWayland

Open slouken opened this issue 9 months ago • 7 comments

I'm not sure when it changed, but I'm running on Ubuntu 22.04 with the default desktop and setting a fullscreen mode doesn't work under XWayland. The XRandR calls appear to work, but the window remains the size of the original desktop.

This affects both SDL2 and SDL3.

slouken avatar Mar 04 '25 00:03 slouken

@Kontrabant, @misyltoad, do you have any insight here?

slouken avatar Apr 25 '25 16:04 slouken

XWayland, not sure why SDL3 picks x11 over wayland by default on a wayland session KDE Fedora 42

Same issue here, after creating a SDL_WINDOW_FULLSCREEN window and SDL_SyncWindow

  • SDL_WINDOW_FULLSCREEN flag is still set
  • SDL_GetWindowFullscreenMode returns NULL indicating the window is in SDL_WINDOW_BORDERLESS mode?
  • the same happens with SDL_VIDEO_DRIVER=wayland

francisdb avatar May 22 '25 07:05 francisdb

Never mind my comment, the docs of SDL_SetWindowFullscreen explain this case.

By default a window in fullscreen state uses borderless fullscreen desktop mode, but a specific exclusive display mode can be set using SDL_SetWindowFullscreenMode().

francisdb avatar May 22 '25 08:05 francisdb

Possibly related: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1797

Kontrabant avatar May 23 '25 17:05 Kontrabant

Possibly related: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1797

I'm completely lost when trying to figure out how to apply that fix; I think it might be something else.

The xwayland branch in use by Linux desktop did not introduce this exact regression from what I can tell, and compiling it still does not result in this working properly.

Has this ever worked on Wayland sessions? ~~What is the last known good xwayland version?~~ Unfortunately, anything prior to 24.1.0 does not work at all ("DRI3 missing"), so testing it like that might be difficult.

fililip avatar Jun 10 '25 14:06 fililip

It has definitely worked before, although if the linked issue didn't cause it, I'm not sure when it broke. The only way to tell would be to start bisecting.

I just found an open upstream issue regarding the problem as well: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1803

Kontrabant avatar Jun 10 '25 16:06 Kontrabant

Ah, I already managed to report my own: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1823, sorry for that. I included a simple reproducer there, hopefully that helps the xserver maintainers.

fililip avatar Jun 10 '25 17:06 fililip