[mutter] window-wayland: Don't insist if the window gives us a bad buffer



commit 6c5595fa9cf44df8ce6f3fac32bcccf8a50ac6d0
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sun Jul 27 18:30:33 2014 +0200

    window-wayland: Don't insist if the window gives us a bad buffer
    
    This is an easy way to get into an infinite loop where we're constantly
    re-sending stuff to the window. If it worked once, it probably won't
    work again.

 src/wayland/window-wayland.c |   36 +++++++++++++++++++-----------------
 1 files changed, 19 insertions(+), 17 deletions(-)
---
diff --git a/src/wayland/window-wayland.c b/src/wayland/window-wayland.c
index fd807c0..f52b4c1 100644
--- a/src/wayland/window-wayland.c
+++ b/src/wayland/window-wayland.c
@@ -203,26 +203,28 @@ meta_window_wayland_move_resize_internal (MetaWindow                *window,
        * new position the client wants. */
       can_move_now = TRUE;
     }
-
-  if (constrained_rect.width != window->rect.width ||
-      constrained_rect.height != window->rect.height)
+  else
     {
-      wl_window->last_sent_width = constrained_rect.width;
-      wl_window->last_sent_height = constrained_rect.height;
+      if (constrained_rect.width != window->rect.width ||
+          constrained_rect.height != window->rect.height)
+        {
+          wl_window->last_sent_width = constrained_rect.width;
+          wl_window->last_sent_height = constrained_rect.height;
 
-      meta_wayland_surface_configure_notify (window->surface,
-                                             constrained_rect.width,
-                                             constrained_rect.height,
-                                             &wl_window->pending_configure_serial);
+          meta_wayland_surface_configure_notify (window->surface,
+                                                 constrained_rect.width,
+                                                 constrained_rect.height,
+                                                 &wl_window->pending_configure_serial);
 
-      /* We need to wait until the resize completes before we can move */
-      can_move_now = FALSE;
-    }
-  else
-    {
-      /* We're just moving the window, so we don't need to wait for a configure
-       * and then ack to simply move the window. */
-      can_move_now = TRUE;
+          /* We need to wait until the resize completes before we can move */
+          can_move_now = FALSE;
+        }
+      else
+        {
+          /* We're just moving the window, so we don't need to wait for a configure
+           * and then ack to simply move the window. */
+          can_move_now = TRUE;
+        }
     }
 
   if (can_move_now)


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