[mutter] pointer: Only the focus_surface should only be influenced by the grab



commit 1a723954fc9a901d02079ea952fccfd76280114d
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Apr 18 18:51:17 2014 -0400

    pointer: Only the focus_surface should only be influenced by the grab
    
    ... not the normal current. That should *always* be the surface under
    the pointer, regardless of events.

 src/wayland/meta-wayland-pointer.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index de46408..f93c22f 100644
--- a/src/wayland/meta-wayland-pointer.c
+++ b/src/wayland/meta-wayland-pointer.c
@@ -358,6 +358,7 @@ repick_for_event (MetaWaylandPointer *pointer,
 {
   ClutterActor *actor = NULL;
   MetaDisplay *display = meta_get_display ();
+  MetaWaylandSurface *focus_surface;
 
   if (for_event)
     {
@@ -377,7 +378,7 @@ repick_for_event (MetaWaylandPointer *pointer,
         }
     }
 
-  if (META_IS_SURFACE_ACTOR_WAYLAND (actor) && !meta_grab_op_should_block_wayland (display->grab_op))
+  if (META_IS_SURFACE_ACTOR_WAYLAND (actor))
     pointer->current = meta_surface_actor_wayland_get_surface (META_SURFACE_ACTOR_WAYLAND (actor));
   else
     pointer->current = NULL;
@@ -385,10 +386,15 @@ repick_for_event (MetaWaylandPointer *pointer,
   if (pointer->cursor_tracker && pointer->current == NULL)
     meta_cursor_tracker_unset_window_cursor (pointer->cursor_tracker);
 
-  if (pointer->current != pointer->focus_surface)
+  if (meta_grab_op_should_block_wayland (display->grab_op))
+    focus_surface = NULL;
+  else
+    focus_surface = pointer->current;
+
+  if (focus_surface != pointer->focus_surface)
     {
       const MetaWaylandPointerGrabInterface *interface = pointer->grab->interface;
-      interface->focus (pointer->grab, pointer->current);
+      interface->focus (pointer->grab, focus_surface);
     }
 }
 


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