Commit 71897cc1c9a9ba2726ef498ad05a6efe473b0b70

Ethan Lee 2021-07-30T15:51:43

wayland: Always trigger a resize when handling a configure event. When we removed the OpenGL resize workaround it introduced a problem for fullscreen windows in particular: When leaving fullscreen we tried to send a resize event, but UpdateFullscreenMode would send a SIZE_CHANGED immediately after, deleting our resize event and causing the following configure event's resize to be ignored. This timing issue resulted in fullscreen windows not being resized at all when becoming a floating window. By always forcing resize events from configure events, we ensure that RESIZED always makes it through. SetWindowSize-type changes should be unaffected as they do not fire configure events.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c
index 209b9e9..e47d343 100644
--- a/src/video/wayland/SDL_waylandwindow.c
+++ b/src/video/wayland/SDL_waylandwindow.c
@@ -1219,7 +1219,7 @@ Wayland_HandlePendingResize(SDL_Window *window)
 
     if (data->resize.pending) {
         struct wl_region *region;
-        if (data->scale_factor != data->resize.scale_factor) {
+        if (data->scale_factor != data->resize.scale_factor || data->resize.configure) {
             window->w = 0;
             window->h = 0;
         }