[mutter] display: Use a named mask constant inside is_moving / is_resizing



commit d06e4beb7fa164c0bdf4f9c51a8db9eb7b3c6eaf
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Aug 15 17:40:52 2014 -0400

    display: Use a named mask constant inside is_moving / is_resizing
    
    This helps clear up what's going on a bit.

 src/core/display.c |    4 ++--
 src/meta/common.h  |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index b1325e3..e847df5 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1191,7 +1191,7 @@ meta_grab_op_is_resizing (MetaGrabOp op)
   if (GRAB_OP_GET_BASE_TYPE (op) != META_GRAB_OP_WINDOW_BASE)
     return FALSE;
 
-  return (op & 0xF000) != 0;
+  return (op & META_GRAB_OP_WINDOW_DIR_MASK) != 0;
 }
 
 gboolean
@@ -1200,7 +1200,7 @@ meta_grab_op_is_moving (MetaGrabOp op)
   if (GRAB_OP_GET_BASE_TYPE (op) != META_GRAB_OP_WINDOW_BASE)
     return FALSE;
 
-  return (op & 0xF000) == 0;
+  return (op & META_GRAB_OP_WINDOW_DIR_MASK) == 0;
 }
 
 /**
diff --git a/src/meta/common.h b/src/meta/common.h
index 776dc1a..7324434 100644
--- a/src/meta/common.h
+++ b/src/meta/common.h
@@ -136,6 +136,7 @@ enum
   META_GRAB_OP_WINDOW_DIR_SOUTH     = 0x4000,
   META_GRAB_OP_WINDOW_DIR_NORTH     = 0x8000,
   META_GRAB_OP_WINDOW_DIR_UNKNOWN   = 0xF000,
+  META_GRAB_OP_WINDOW_DIR_MASK      = 0xF000,
 
   /* WGO = "window grab op". shorthand for below */
   _WGO_K = META_GRAB_OP_WINDOW_FLAG_KEYBOARD,


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