[mutter] pointer: Forcibly steal pointer focus when the compositor has a grab



commit a0e038f34b0c5a0e82459734386c5eaea2790aae
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Nov 26 15:23:36 2014 -0800

    pointer: Forcibly steal pointer focus when the compositor has a grab

 src/wayland/meta-wayland-pointer.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index 5d92025..2b99183 100644
--- a/src/wayland/meta-wayland-pointer.c
+++ b/src/wayland/meta-wayland-pointer.c
@@ -251,7 +251,6 @@ static void
 sync_focus_surface (MetaWaylandPointer *pointer)
 {
   MetaDisplay *display = meta_get_display ();
-  MetaWaylandSurface *focus_surface;
 
   switch (display->event_route)
     {
@@ -260,21 +259,22 @@ sync_focus_surface (MetaWaylandPointer *pointer)
       return;
 
     case META_EVENT_ROUTE_COMPOSITOR_GRAB:
-      /* The compositor has focus, so remove our focus... */
-      focus_surface = NULL;
+      /* The compositor has a grab, so remove our focus... */
+      meta_wayland_pointer_set_focus (pointer, NULL);
       break;
 
     case META_EVENT_ROUTE_NORMAL:
     case META_EVENT_ROUTE_WAYLAND_POPUP:
-      focus_surface = pointer->current;
+      {
+        const MetaWaylandPointerGrabInterface *interface = pointer->grab->interface;
+        interface->focus (pointer->grab, pointer->current);
+      }
       break;
 
     default:
       g_assert_not_reached ();
     }
 
-  const MetaWaylandPointerGrabInterface *interface = pointer->grab->interface;
-  interface->focus (pointer->grab, focus_surface);
 }
 
 static void


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