Browse Source

Revert "wayland: Don't send size events while the window is hidden"

This reverts commit 0825d07a43a891350e6ae7ea02912c87eb1db952.

It turns out that resizing while hidden is fine, the real problem in https://github.com/libsdl-org/sdl2-compat/issues/268 is that SDL2 did not send an initial resize event and SDL3 does, which we're fixing in a better way in sdl2-compat.
Sam Lantinga 2 months ago
parent
commit
c59ac249d2
1 changed files with 6 additions and 8 deletions
  1. 6 8
      src/video/wayland/SDL_waylandwindow.c

+ 6 - 8
src/video/wayland/SDL_waylandwindow.c

@@ -441,15 +441,13 @@ static bool ConfigureWindowGeometry(SDL_Window *window)
      */
     SetMinMaxDimensions(window);
 
-    if (data->shell_surface_status != WAYLAND_SHELL_SURFACE_STATUS_HIDDEN) {
-        // Unconditionally send the window and drawable size, the video core will deduplicate when required.
-        if (!data->scale_to_display) {
-            SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_RESIZED, window_width, window_height);
-        } else {
-            SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_RESIZED, data->current.pixel_width, data->current.pixel_height);
-        }
-        SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED, data->current.pixel_width, data->current.pixel_height);
+    // Unconditionally send the window and drawable size, the video core will deduplicate when required.
+    if (!data->scale_to_display) {
+        SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_RESIZED, window_width, window_height);
+    } else {
+        SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_RESIZED, data->current.pixel_width, data->current.pixel_height);
     }
+    SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED, data->current.pixel_width, data->current.pixel_height);
 
     /* Send an exposure event if the window is in the shown state and the size has changed,
      * even if the window is occluded, as the client needs to commit a new frame for the