فهرست منبع

wayland: Make sure the correct cached window dimensions are used when a config size of 0,0 is received

The window may be in a maximized or tiled state, in which case, don't use the floating size.
Frank Praznik 11 ماه پیش
والد
کامیت
baacbeb4c4
1فایلهای تغییر یافته به همراه11 افزوده شده و 4 حذف شده
  1. 11 4
      src/video/wayland/SDL_waylandwindow.c

+ 11 - 4
src/video/wayland/SDL_waylandwindow.c

@@ -777,11 +777,18 @@ static void handle_configure_xdg_toplevel(void *data,
         if (window->flags & SDL_WINDOW_RESIZABLE) {
             if ((floating && !wind->floating) ||
                 width == 0 || height == 0) {
-                /* This happens when we're being restored from a
-                 * non-floating state, so use the cached floating size here.
+                /* This happens when we're being restored from a non-floating state,
+                 * or the compositor indicates that the size is up to the client, so
+                 * used the cached window size here.
                  */
-                width = window->floating.w;
-                height = window->floating.h;
+                if (floating) {
+                    width = window->floating.w;
+                    height = window->floating.h;
+                } else {
+                    width = window->windowed.w;
+                    height = window->windowed.h;
+                }
+
                 if (wind->scale_to_display) {
                     wind->requested.logical_width = PixelToPoint(window, width);
                     wind->requested.logical_height = PixelToPoint(window, height);