[gtk/simple-resizing-fixes: 3/4] wayland: Don't forget to reapply margins




commit 082edd957e0fc4cd5dd6109664ba4c0b65f643c7
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Oct 5 20:17:50 2020 -0400

    wayland: Don't forget to reapply margins
    
    When using the saved size because the compositor
    told us to, we were forgetting to readd the margins.
    
    The visible symptom of this was the window getting
    smaller every time we went to tiled state and back.

 gdk/wayland/gdksurface-wayland.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index 87eaae752d..72cbc8c2d7 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -1354,6 +1354,11 @@ gdk_wayland_surface_configure_toplevel (GdkSurface *surface)
           /* Save size for next time we get 0x0 */
           _gdk_wayland_surface_save_size (surface);
         }
+      else
+        {
+          width += impl->margin_left + impl->margin_right;
+          height += impl->margin_top + impl->margin_bottom;
+        }
 
       gdk_wayland_surface_resize (surface, width, height, impl->scale);
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]