display: Replace the inline logic with a static inline

So we won't get it wrong in the future.
This commit is contained in:
Jasper St. Pierre 2014-08-15 17:44:25 -04:00
parent f2283ec634
commit c3e87ee896

View File

@ -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;