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:
parent
5216137146
commit
9f071fdc87
@ -86,6 +86,9 @@ static guint signals[LAST_SIGNAL];
|
|||||||
G_DEFINE_TYPE (MetaWaylandPointer, meta_wayland_pointer,
|
G_DEFINE_TYPE (MetaWaylandPointer, meta_wayland_pointer,
|
||||||
META_TYPE_WAYLAND_INPUT_DEVICE)
|
META_TYPE_WAYLAND_INPUT_DEVICE)
|
||||||
|
|
||||||
|
static void
|
||||||
|
meta_wayland_pointer_reset_grab (MetaWaylandPointer *pointer);
|
||||||
|
|
||||||
static MetaWaylandPointerClient *
|
static MetaWaylandPointerClient *
|
||||||
meta_wayland_pointer_client_new (void)
|
meta_wayland_pointer_client_new (void)
|
||||||
{
|
{
|
||||||
@ -495,7 +498,7 @@ meta_wayland_pointer_disable (MetaWaylandPointer *pointer)
|
|||||||
pointer->cursor_surface_destroy_id);
|
pointer->cursor_surface_destroy_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_wayland_pointer_end_grab (pointer);
|
meta_wayland_pointer_reset_grab (pointer);
|
||||||
meta_wayland_pointer_set_focus (pointer, NULL);
|
meta_wayland_pointer_set_focus (pointer, NULL);
|
||||||
|
|
||||||
g_clear_pointer (&pointer->pointer_clients, g_hash_table_unref);
|
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);
|
interface->focus (pointer->grab, pointer->current);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
meta_wayland_pointer_reset_grab (MetaWaylandPointer *pointer)
|
||||||
|
{
|
||||||
|
pointer->grab = &pointer->default_grab;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_wayland_pointer_end_grab (MetaWaylandPointer *pointer)
|
meta_wayland_pointer_end_grab (MetaWaylandPointer *pointer)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user