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



commit 7990182f566a84ab5b07218244371e151da0f447
Author: Jonas Ådahl <jadahl gmail com>
Date:   Wed Sep 21 14:30:15 2016 +0800

    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

 src/wayland/meta-wayland-pointer.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index bb94557..55fcb06 100644
--- a/src/wayland/meta-wayland-pointer.c
+++ b/src/wayland/meta-wayland-pointer.c
@@ -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)
 {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]