From d09116ebce9c5a2c08a9d28dd8117ec7d58a4956 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sun, 20 Apr 2014 11:43:10 -0400 Subject: [PATCH] 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 e789537b2..c141c4cf2 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 28a9a3999..858dfab51 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -1169,37 +1169,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) { @@ -1265,6 +1234,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) { diff --git a/src/core/events.c b/src/core/events.c index 7b272571f..4bb1b6dc8 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 19f03ea33..5243413bd 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))