wayland/pointer: Use grab helper that doesn't focus when disabling

Instead of using meta_wayland_pointer_end_grab() which focuses the new
grab, add a new helper mean to be used to reset the grab state without
changing the pointer focus. When using this function, the call site is
supposed to explicitly manage focus.

https://bugzilla.gnome.org/show_bug.cgi?id=771646
This commit is contained in:
Jonas Ådahl 2016-09-21 14:30:15 +08:00
parent 93a6be08a5
commit 7990182f56

View File

@ -86,6 +86,9 @@ static guint signals[LAST_SIGNAL];
G_DEFINE_TYPE (MetaWaylandPointer, meta_wayland_pointer,
META_TYPE_WAYLAND_INPUT_DEVICE)
static void
meta_wayland_pointer_reset_grab (MetaWaylandPointer *pointer);
static MetaWaylandPointerClient *
meta_wayland_pointer_client_new (void)
{
@ -495,7 +498,7 @@ meta_wayland_pointer_disable (MetaWaylandPointer *pointer)
pointer->cursor_surface_destroy_id);
}
meta_wayland_pointer_end_grab (pointer);
meta_wayland_pointer_reset_grab (pointer);
meta_wayland_pointer_set_focus (pointer, NULL);
g_clear_pointer (&pointer->pointer_clients, g_hash_table_unref);
@ -866,6 +869,12 @@ meta_wayland_pointer_start_grab (MetaWaylandPointer *pointer,
interface->focus (pointer->grab, pointer->current);
}
static void
meta_wayland_pointer_reset_grab (MetaWaylandPointer *pointer)
{
pointer->grab = &pointer->default_grab;
}
void
meta_wayland_pointer_end_grab (MetaWaylandPointer *pointer)
{