[mutter] display: Rename meta_grab_op_is_mouse to is_moving_or_resizing



commit d09116ebce9c5a2c08a9d28dd8117ec7d58a4956
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sun Apr 20 11:43:10 2014 -0400

    display: Rename meta_grab_op_is_mouse to is_moving_or_resizing
    
    is_mouse actually checks for all combinations of moving/resizing
    grab ops, which is quite confusing. Just rename it.

 src/core/display-private.h         |    2 +-
 src/core/display.c                 |   38 ++++++-----------------------------
 src/core/events.c                  |    4 +-
 src/wayland/meta-wayland-pointer.c |    4 +-
 4 files changed, 12 insertions(+), 36 deletions(-)
---
diff --git a/src/core/display-private.h b/src/core/display-private.h
index e789537..c141c4c 100644
--- a/src/core/display-private.h
+++ b/src/core/display-private.h
@@ -439,7 +439,7 @@ int meta_resize_gravity_from_grab_op (MetaGrabOp op);
 
 gboolean meta_grab_op_is_moving   (MetaGrabOp op);
 gboolean meta_grab_op_is_resizing (MetaGrabOp op);
-gboolean meta_grab_op_is_mouse    (MetaGrabOp op);
+gboolean meta_grab_op_is_moving_or_resizing (MetaGrabOp op);
 gboolean meta_grab_op_is_mouse_only (MetaGrabOp op);
 gboolean meta_grab_op_is_clicking (MetaGrabOp op);
 gboolean meta_grab_op_is_keyboard (MetaGrabOp op);
diff --git a/src/core/display.c b/src/core/display.c
index 28a9a39..858dfab 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1170,37 +1170,6 @@ meta_grab_op_is_mouse_only (MetaGrabOp op)
 }
 
 gboolean
-meta_grab_op_is_mouse (MetaGrabOp op)
-{
-  switch (op)
-    {
-    case META_GRAB_OP_MOVING:
-    case META_GRAB_OP_RESIZING_SE:
-    case META_GRAB_OP_RESIZING_S:      
-    case META_GRAB_OP_RESIZING_SW:      
-    case META_GRAB_OP_RESIZING_N:
-    case META_GRAB_OP_RESIZING_NE:
-    case META_GRAB_OP_RESIZING_NW:
-    case META_GRAB_OP_RESIZING_W:
-    case META_GRAB_OP_RESIZING_E:
-    case META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN:
-    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:
-    case META_GRAB_OP_KEYBOARD_MOVING:
-      return TRUE;
-
-    default:
-      return FALSE;
-    }
-}
-
-gboolean
 meta_grab_op_is_keyboard (MetaGrabOp op)
 {
   switch (op)
@@ -1266,6 +1235,13 @@ meta_grab_op_is_moving (MetaGrabOp op)
 }
 
 gboolean
+meta_grab_op_is_moving_or_resizing (MetaGrabOp op)
+{
+  return (meta_grab_op_is_moving (op) ||
+          meta_grab_op_is_resizing (op));
+}
+
+gboolean
 meta_grab_op_is_clicking (MetaGrabOp grab_op)
 {
   switch (grab_op)
diff --git a/src/core/events.c b/src/core/events.c
index 7b27257..4bb1b6d 100644
--- a/src/core/events.c
+++ b/src/core/events.c
@@ -2122,7 +2122,7 @@ meta_display_handle_event (MetaDisplay        *display,
       display->overlay_key_only_pressed = FALSE;
 
       if (display->grab_window == window &&
-          meta_grab_op_is_mouse (display->grab_op))
+          meta_grab_op_is_moving_or_resizing (display->grab_op))
         {
           meta_window_handle_mouse_grab_op_event (window, event);
           bypass_clutter = TRUE;
@@ -2134,7 +2134,7 @@ meta_display_handle_event (MetaDisplay        *display,
         break;
 
       if (display->grab_window == window &&
-          meta_grab_op_is_mouse (display->grab_op))
+          meta_grab_op_is_moving_or_resizing (display->grab_op))
         {
           meta_window_handle_mouse_grab_op_event (window, event);
           bypass_clutter = TRUE;
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index 19f03ea..5243413 100644
--- a/src/wayland/meta-wayland-pointer.c
+++ b/src/wayland/meta-wayland-pointer.c
@@ -358,8 +358,8 @@ sync_focus_surface (MetaWaylandPointer *pointer)
   MetaDisplay *display = meta_get_display ();
   MetaWaylandSurface *focus_surface;
 
-  /* Don't update the focus surface while we have a special grab. */
-  if (meta_grab_op_is_mouse (display->grab_op))
+  /* Don't update the focus surface while we have a move/resize grab. */
+  if (meta_grab_op_is_moving_or_resizing (display->grab_op))
     return;
 
   if (meta_grab_op_should_block_wayland (display->grab_op))


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