We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4363

Summary: [PATCH] wayland: broken window resizing - wrong fullscreen toggling, race conditions on resize
Product: SDL Reporter: Sebastian Krzyszkowiak <dos>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.1   
Hardware: x86_64   
OS: Linux   
Attachments: Patch

Description Sebastian Krzyszkowiak 2018-11-07 00:21:53 UTC
Created attachment 3450 [details]
Patch

For starters, we need to correctly respond to 0,0 configure after unsetting fullscreen, since the window manager won't have proper dimensions cached if the window already started as fullscreen.

Also, after a discussion on #wayland, turned out that there should be no drawing calls at all in between eglSwapBuffers and wl_egl_window_resize, as otherwise EGL can already allocate a wrongly sized buffer for a next frame, which causes misbehavior and in the case of Weston even unrecoverable errors.

Tested with Weston, Rootston, Sway, KWin and Mutter. For perfect operation, KWin needs a patch from https://phabricator.kde.org/D16710, while Mutter needs to fix https://gitlab.gnome.org/GNOME/mutter/issues/378
Comment 1 Sam Lantinga 2018-11-07 00:46:57 UTC
Patch added, thanks!
https://hg.libsdl.org/SDL/rev/28303fca62bd