display: Expose meta_grab_op_is_mouse_only

And use it properly in some event handling code.
This commit is contained in:
Jasper St. Pierre 2014-04-20 11:41:22 -04:00
parent e55dd4e3f4
commit beca90a689
3 changed files with 5 additions and 4 deletions

View File

@ -440,6 +440,7 @@ int meta_resize_gravity_from_grab_op (MetaGrabOp op);
gboolean meta_grab_op_is_moving (MetaGrabOp op); gboolean meta_grab_op_is_moving (MetaGrabOp op);
gboolean meta_grab_op_is_resizing (MetaGrabOp op); gboolean meta_grab_op_is_resizing (MetaGrabOp op);
gboolean meta_grab_op_is_mouse (MetaGrabOp op); gboolean meta_grab_op_is_mouse (MetaGrabOp op);
gboolean meta_grab_op_is_mouse_only (MetaGrabOp op);
gboolean meta_grab_op_is_clicking (MetaGrabOp op); gboolean meta_grab_op_is_clicking (MetaGrabOp op);
gboolean meta_grab_op_is_keyboard (MetaGrabOp op); gboolean meta_grab_op_is_keyboard (MetaGrabOp op);
gboolean meta_grab_op_should_block_wayland (MetaGrabOp op); gboolean meta_grab_op_should_block_wayland (MetaGrabOp op);

View File

@ -1148,8 +1148,8 @@ meta_get_display (void)
return the_display; return the_display;
} }
static gboolean gboolean
grab_op_is_mouse_only (MetaGrabOp op) meta_grab_op_is_mouse_only (MetaGrabOp op)
{ {
switch (op) switch (op)
{ {
@ -1915,7 +1915,7 @@ meta_display_begin_grab_op (MetaDisplay *display,
} }
/* Grab keys for keyboard ops and mouse move/resizes; see #126497 */ /* Grab keys for keyboard ops and mouse move/resizes; see #126497 */
if (meta_grab_op_is_keyboard (op) || grab_op_is_mouse_only (op)) if (meta_grab_op_is_keyboard (op) || meta_grab_op_is_mouse_only (op))
{ {
if (grab_window) if (grab_window)
display->grab_have_keyboard = display->grab_have_keyboard =

View File

@ -1950,7 +1950,7 @@ meta_display_handle_event (MetaDisplay *display,
display->overlay_key_only_pressed = FALSE; display->overlay_key_only_pressed = FALSE;
if ((window && if ((window &&
meta_grab_op_is_mouse (display->grab_op) && meta_grab_op_is_mouse_only (display->grab_op) &&
(event->button.modifier_state & display->window_grab_modifiers) && (event->button.modifier_state & display->window_grab_modifiers) &&
display->grab_button != (int) event->button.button && display->grab_button != (int) event->button.button &&
display->grab_window == window) || display->grab_window == window) ||