[mutter] window: Adjust the frame rect when _GTK_FRAME_EXTENTS is set on map



commit 461aea47dd1da1b32a734d080aa160ca2709f6b3
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Sep 17 12:17:01 2014 -0600

    window: Adjust the frame rect when _GTK_FRAME_EXTENTS is set on map

 src/x11/window-props.c |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/src/x11/window-props.c b/src/x11/window-props.c
index e857788..3164985 100644
--- a/src/x11/window-props.c
+++ b/src/x11/window-props.c
@@ -350,7 +350,8 @@ gtk_border_equal (GtkBorder *a,
 
 static void
 meta_window_set_custom_frame_extents (MetaWindow *window,
-                                      GtkBorder  *extents)
+                                      GtkBorder  *extents,
+                                      gboolean    is_initial)
 {
   if (extents)
     {
@@ -359,6 +360,17 @@ meta_window_set_custom_frame_extents (MetaWindow *window,
 
       window->has_custom_frame_extents = TRUE;
       window->custom_frame_extents = *extents;
+
+      /* If we're setting the frame extents on map, then this is telling
+       * us to adjust our understanding of the frame rect to match what
+       * GTK+ thinks it is. Future changes to the frame extents should
+       * trigger a resize and send a ConfigureRequest to the application.
+       */
+      if (is_initial)
+        {
+          meta_window_client_rect_to_frame_rect (window, &window->rect, &window->rect);
+          meta_window_client_rect_to_frame_rect (window, &window->unconstrained_rect, 
&window->unconstrained_rect);
+        }
     }
   else
     {
@@ -391,12 +403,12 @@ reload_gtk_frame_extents (MetaWindow    *window,
           extents.right  = (int)value->v.cardinal_list.cardinals[1];
           extents.top    = (int)value->v.cardinal_list.cardinals[2];
           extents.bottom = (int)value->v.cardinal_list.cardinals[3];
-          meta_window_set_custom_frame_extents (window, &extents);
+          meta_window_set_custom_frame_extents (window, &extents, initial);
         }
     }
   else
     {
-      meta_window_set_custom_frame_extents (window, NULL);
+      meta_window_set_custom_frame_extents (window, NULL, initial);
     }
 }
 


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