Skip to content
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

wayland: Fix toggling fullscreen with fixed-size windows #4285

Merged
merged 2 commits into from
Apr 7, 2021

Conversation

flibitijibibo
Copy link
Collaborator

Fixes #4281.

Continuing off my work from #4065, it looks like Wayland took even more notes from X and made the min/max an issue when calling the set_fullscreen functions, causing the display server to clamp the window and resize it to something really weird and wrong. The solution was to fold all of the min/max work into a new function and do a full commit every single time we change the dimensions in some way. It turns out it's cleaner like this anyway!

src/video/wayland/SDL_waylandwindow.c Outdated Show resolved Hide resolved
src/video/wayland/SDL_waylandwindow.c Outdated Show resolved Hide resolved
@flibitijibibo
Copy link
Collaborator Author

Pushed an update per review comments from @christianrauch, thanks for the tips!

…reen_mode.

Because Wayland only supports FULLSCREEN_DESKTOP, fullscreen_mode never gets
assigned at all, meaning driverdata is always NULL! Depending on what the
compositor does this can lead to dramatically different results. GNOME was fine
without this, but Plasma would trip an event that unintentionally unset the
fullscreen mode and caused the game to fire a configure event _every frame_,
and of course the configure would send the fullscreen_mode output which was
still empty. The fix is to just use the SDL_VideoDisplay directly, which will
always have a valid wl_output.
@flibitijibibo
Copy link
Collaborator Author

Pushed an additional commit that fixes this for Plasma as well. The behavior was radically different because of an unassigned wl_output variable, which should have affected every Wayland environment but mysteriously only affected Plasma.

@slouken slouken merged commit a92cca1 into libsdl-org:main Apr 7, 2021
@flibitijibibo flibitijibibo deleted the x11-flashbacks branch April 7, 2021 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Wayland] Fullscreen toggles get canceled out by a bogus resize
3 participants