[mutter] display: Replace the inline logic with a static inline
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] display: Replace the inline logic with a static inline
- Date: Fri, 15 Aug 2014 21:46:50 +0000 (UTC)
commit c3e87ee896b27248e222d6b3e2b15d706ace8a5b
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Fri Aug 15 17:44:25 2014 -0400
display: Replace the inline logic with a static inline
So we won't get it wrong in the future.
src/core/display.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index cf3cec3..71883cf 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1167,10 +1167,16 @@ meta_get_display (void)
return the_display;
}
+static inline gboolean
+grab_op_is_window (MetaGrabOp op)
+{
+ return GRAB_OP_GET_BASE_TYPE (op) == META_GRAB_OP_WINDOW_BASE;
+}
+
gboolean
meta_grab_op_is_mouse (MetaGrabOp op)
{
- if (GRAB_OP_GET_BASE_TYPE (op) != META_GRAB_OP_WINDOW_BASE)
+ if (grab_op_is_window (op))
return FALSE;
return (op & META_GRAB_OP_WINDOW_FLAG_KEYBOARD) == 0;
@@ -1179,7 +1185,7 @@ meta_grab_op_is_mouse (MetaGrabOp op)
gboolean
meta_grab_op_is_keyboard (MetaGrabOp op)
{
- if (GRAB_OP_GET_BASE_TYPE (op) != META_GRAB_OP_WINDOW_BASE)
+ if (grab_op_is_window (op))
return FALSE;
return (op & META_GRAB_OP_WINDOW_FLAG_KEYBOARD) != 0;
@@ -1188,7 +1194,7 @@ meta_grab_op_is_keyboard (MetaGrabOp op)
gboolean
meta_grab_op_is_resizing (MetaGrabOp op)
{
- if (GRAB_OP_GET_BASE_TYPE (op) != META_GRAB_OP_WINDOW_BASE)
+ if (grab_op_is_window (op))
return FALSE;
return (op & META_GRAB_OP_WINDOW_DIR_MASK) != 0;
@@ -1197,7 +1203,7 @@ meta_grab_op_is_resizing (MetaGrabOp op)
gboolean
meta_grab_op_is_moving (MetaGrabOp op)
{
- if (GRAB_OP_GET_BASE_TYPE (op) != META_GRAB_OP_WINDOW_BASE)
+ if (grab_op_is_window (op))
return FALSE;
return (op & META_GRAB_OP_WINDOW_DIR_MASK) == 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]