display: Rename grab_op_is_wayland to grab_op_should_block_wayland

The idea here is that while we take a WM-side grab, like a compositor
grab or a resizing grab, we need to remove the focus from the Wayland
client.

We make a special exception for CLICKING operations, because these
are really an internal state machine while you're pressing on a button
inside a frame, and in this case, we need to not kill the focus.
This commit is contained in:
Jasper St. Pierre 2014-04-12 00:13:57 -07:00
parent d004f3f990
commit 30d534f17e
3 changed files with 12 additions and 4 deletions

View File

@ -441,8 +441,8 @@ 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_clicking (MetaGrabOp op);
gboolean meta_grab_op_is_wayland (MetaGrabOp op);
gboolean meta_grab_op_is_keyboard (MetaGrabOp op);
gboolean meta_grab_op_should_block_wayland (MetaGrabOp op);
void meta_display_devirtualize_modifiers (MetaDisplay *display,
MetaVirtualModifier modifiers,

View File

@ -1290,8 +1290,16 @@ meta_grab_op_is_clicking (MetaGrabOp grab_op)
}
}
/**
* meta_grab_op_should_block_wayland:
* @op: A #MetaGrabOp
*
* Starting a grab with one of these grab operations means
* that we will remove key / pointer focus from the current
* Wayland focus.
*/
gboolean
meta_grab_op_is_wayland (MetaGrabOp op)
meta_grab_op_should_block_wayland (MetaGrabOp op)
{
return (op != META_GRAB_OP_NONE && !meta_grab_op_is_clicking (op));
}
@ -1514,7 +1522,7 @@ meta_display_sync_wayland_input_focus (MetaDisplay *display)
MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default ();
MetaWindow *focus_window = NULL;
if (meta_grab_op_is_wayland (display->grab_op))
if (meta_grab_op_should_block_wayland (display->grab_op))
focus_window = NULL;
else if (meta_display_xwindow_is_a_no_focus_window (display, display->focus_xwindow))
focus_window = NULL;

View File

@ -461,7 +461,7 @@ meta_wayland_seat_repick (MetaWaylandSeat *seat,
MetaWaylandSurface *surface = NULL;
MetaDisplay *display = meta_get_display ();
if (meta_grab_op_is_wayland (display->grab_op))
if (meta_grab_op_should_block_wayland (display->grab_op))
{
meta_wayland_pointer_update_current_focus (pointer, NULL);
return;