[mutter/wip/frame-synchronization: 121/121] Consistently use meta_grab_op_is_resizing() for _NET_WM_SYNC_REQUEST



commit d317c1c7e8d6904471b32f41d1bf967d2b35c72a
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Wed Jan 30 14:49:31 2013 -0500

    Consistently use meta_grab_op_is_resizing() for _NET_WM_SYNC_REQUEST
    
    In different places we checked the grab op differently when determing
    whether we are using _NET_WM_SYNC_REQUEST. This was somewhat covered
    up previously by the fact that we only had a sync alarm when using
    _NET_WM_SYNC_REQUEST, but that is no longer the case, so consistently
    use meta_grab_op_is_resizing() everywhere.

 src/core/window.c |   43 ++++++++++---------------------------------
 1 files changed, 10 insertions(+), 33 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index 73aa0a9..22fc90a 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -5114,6 +5114,7 @@ meta_window_move_resize_internal (MetaWindow          *window,
 
 #ifdef HAVE_XSYNC
       if (window == window->display->grab_window &&
+          meta_grab_op_is_resizing (window->display->grab_op) &&
           window->sync_request_counter != None &&
 	  window->sync_request_alarm != None &&
 	  window->sync_request_time.tv_usec == 0 &&
@@ -9456,9 +9457,8 @@ meta_window_update_sync_request_counter (MetaWindow *window,
   meta_compositor_set_updates_frozen (window->display->compositor, window,
                                       meta_window_updates_are_frozen (window));
 
-  if (window->display->grab_op != META_GRAB_OP_NONE &&
-      window == window->display->grab_window &&
-      meta_grab_op_is_mouse (window->display->grab_op) &&
+  if (window == window->display->grab_window &&
+      meta_grab_op_is_resizing (window->display->grab_op) &&
       new_counter_value >= window->display->grab_sync_counter_wait_serial)
     {
       meta_topic (META_DEBUG_RESIZING,
@@ -9474,36 +9474,13 @@ meta_window_update_sync_request_counter (MetaWindow *window,
       window->sync_request_time.tv_sec = 0;
       window->sync_request_time.tv_usec = 0;
 
-      /* This means we are ready for another configure. */
-      switch (window->display->grab_op)
-        {
-        case META_GRAB_OP_RESIZING_E:
-        case META_GRAB_OP_RESIZING_W:
-        case META_GRAB_OP_RESIZING_S:
-        case META_GRAB_OP_RESIZING_N:
-        case META_GRAB_OP_RESIZING_SE:
-        case META_GRAB_OP_RESIZING_SW:
-        case META_GRAB_OP_RESIZING_NE:
-        case META_GRAB_OP_RESIZING_NW:
-        case META_GRAB_OP_KEYBOARD_RESIZING_S:
-        case META_GRAB_OP_KEYBOARD_RESIZING_N:
-        case META_GRAB_OP_KEYBOARD_RESIZING_W:
-        case META_GRAB_OP_KEYBOARD_RESIZING_E:
-        case META_GRAB_OP_KEYBOARD_RESIZING_SE:
-        case META_GRAB_OP_KEYBOARD_RESIZING_NE:
-        case META_GRAB_OP_KEYBOARD_RESIZING_SW:
-        case META_GRAB_OP_KEYBOARD_RESIZING_NW:
-          /* no pointer round trip here, to keep in sync */
-          update_resize (window,
-                         window->display->grab_last_user_action_was_snap,
-                         window->display->grab_latest_motion_x,
-                         window->display->grab_latest_motion_y,
-                         TRUE);
-          break;
-
-        default:
-          break;
-        }
+      /* This means we are ready for another configure;
+       * no pointer round trip here, to keep in sync */
+      update_resize (window,
+                     window->display->grab_last_user_action_was_snap,
+                     window->display->grab_latest_motion_x,
+                     window->display->grab_latest_motion_y,
+                     TRUE);
     }
 }
 #endif /* HAVE_XSYNC */



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