SDL
SDL copied to clipboard
SDL_SetWindowFullscreen don't create SDL_WINDOWEVENT_SIZE_CHANGED event
The SDL_SetWindowFullscreen function does not raise the SDL_WINDOWEVENT_SIZE_CHANGED event, but when exiting fullscreen with SDL_SetWindowFullscreen(window, 0) the event is raised, possibly due to the mesa update to version 22.1.5
In libsdl2-2.0.22
I can't reproduce this here on X11. Is this a Wayland thing, maybe?
No, it's from X11 on gentoo. kwin-5.25.4-r1 xorg-server-21.1.4 nvidia-drivers-390.151 I don't know what additional information you may need.
More or less one out of ten times that I test it works fine, it may be a kwin_x11 error because when kwin_x11 is off the event is generated correctly.
If I start my application with SDL_WINDOW_FULLSCREEN_DESKTOP it works as intended, if I toggle it using SDL_SetWindowFullscreen then the image is not re-scaled but the window is indeed fullscreen. Could this be related?
@omgitsaheadcrab It's the same problem, if I start my application with SDL_WINDOW_FULLSCREEN_DESKTOP it works fine the problem only happens from window to full screen.
Moving to 2.24 in case I can reproduce this quickly with this new info, but it's bumping back to 2.26 if not (we're almost out of time for 2.24).
I also ran into this bug. SDL_Window is created with SDL_WINDOW_VULKAN | SDL_WINDOW_RESIZABLE.
Some extra details:
- If I resize the window beforehand I'm not able to reproduce this bug.
SIZE_CHANGEDis sent everytime when exiting fullscreen state, but not when entering- Calling
SDL_GetWindowSizeafterSDL_SetWindowFullscreendoes always report correct size - Usually (not always) when entering
FULLSCREEN_DESKTOPfor the 3rd time,SIZE_CHANGEDevent is finally sent - On my laptop running Plasma Wayland I can also reproduce this bug with
SDL_VIDEODRIVER=x11 - On same laptop I can't reproduce this problem if running with
SDL_VIDEODRIVER=wayland
Both computers are running kwin-5.25.4. Desktop is running xorg-server 21.1.4 and nvidia-515.49.06 Laptop is running xorg-xwayland 22.1.3 and mesa 22.1.4
Running SDL_EVENT_LOGGING=1 ./testvulkan --resizable here and pressing alt-enter to go fullscreen_desktop and back is working correctly on Gnome/x11; I get a SIZE_CHANGED for both going and coming from fullscreen_desktop mode.
It's possible it only triggers on kwin...?
Remove kwin and put twm, it worked correctly, I have no gnome to test.
Wait, this does reproduce for me with Gnome, if I use the actual 2.0.22 release. The latest in revision control works correctly...it's possible this was fixed by cf63af8ae265c99e80ffc93e9930336c939524bc in some way I don't understand yet. I'll bisect and see if it was something else instead.
Has anyone tried this on kwin with the latest SDL, or has this all been tested with 2.0.22?
The actual fix was 9edd411a8315540b86fceec590dd5aa6be41f5f0, which was made after 2.0.22 shipped (this explicitly generates a RESIZED event in response to a fullscreen change, which will cause SDL to generate a SIZED_CHANGED event under the hood as well).
I'm assuming this is fixed for 2.24.0 already, but if you find this is still busted on kwin with the latest in revision control, please let me know and I'll reopen the issue. Thanks!