[mutter] window-x11: Calculate size_dx / size_dy before assigning to window->rect



commit aa848134007502175927c69d667789c70f891fb4
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed May 21 13:00:25 2014 -0400

    window-x11: Calculate size_dx / size_dy before assigning to window->rect
    
    This makes sure that we grow / shrink the frame and window in the
    correct order.

 src/x11/window-x11.c |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)
---
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
index fe71649..a4c2249 100644
--- a/src/x11/window-x11.c
+++ b/src/x11/window-x11.c
@@ -1031,8 +1031,10 @@ meta_window_x11_move_resize_internal (MetaWindow                *window,
   w = constrained_rect.width;
   h = constrained_rect.height;
 
-  if (w != window->rect.width ||
-      h != window->rect.height)
+  size_dx = w - window->rect.width;
+  size_dy = h - window->rect.height;
+
+  if (size_dx != 0 || size_dy != 0)
     need_resize_client = TRUE;
 
   window->rect.width = w;
@@ -1174,16 +1176,9 @@ meta_window_x11_move_resize_internal (MetaWindow                *window,
    * the client finishes redrawing.
    */
   if (window->extended_sync_request_counter)
-    {
-      configure_frame_first = TRUE;
-    }
+    configure_frame_first = TRUE;
   else
-    {
-      size_dx = w - window->rect.width;
-      size_dy = h - window->rect.height;
-
-      configure_frame_first = size_dx + size_dy >= 0;
-    }
+    configure_frame_first = size_dx + size_dy >= 0;
 
   if (configure_frame_first && window->frame)
     frame_shape_changed = meta_frame_sync_to_window (window->frame,


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