[gtk/gtk-3-24: 3/4] wayland: Store unconfigured size without margin



commit 814d1e7f06465cb4a3ae4bfbdf07eb29904319e8
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Mon Apr 6 12:07:51 2020 +0200

    wayland: Store unconfigured size without margin
    
    We get the unconfigured size request either with or without the shadow
    margin already configured, so to get some consistency with the 'saved
    size', cut away any potential shadow margin from the size before
    storing.
    
    Then when using, add it back, so we always create a configure event with
    the correct size.
    
    Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2576

 gdk/wayland/gdkwindow-wayland.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 8e2e0236d4..6c555443bd 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -1149,8 +1149,10 @@ gdk_wayland_window_maybe_configure (GdkWindow *window,
   if (needs_initial_configure (window) &&
       !impl->initial_configure_received)
     {
-      impl->unconfigured_width = width;
-      impl->unconfigured_height = height;
+      impl->unconfigured_width = calculate_width_without_margin (window,
+                                                                 width);
+      impl->unconfigured_height = calculate_height_without_margin (window,
+                                                                   height);
       return;
     }
 
@@ -1676,9 +1678,16 @@ gdk_wayland_window_handle_configure (GdkWindow *window,
     }
   else
     {
+      int unconfigured_width;
+      int unconfigured_height;
+
+      unconfigured_width =
+        calculate_width_with_margin (window, impl->unconfigured_width);
+      unconfigured_height =
+        calculate_height_with_margin (window, impl->unconfigured_height);
       gdk_wayland_window_configure (window,
-                                    impl->unconfigured_width,
-                                    impl->unconfigured_height,
+                                    unconfigured_width,
+                                    unconfigured_height,
                                     impl->scale);
     }
 


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