[mutter] pointer: Merge update_current_focus and repick_for_event



commit d68da0b8cffd23564986f53c547241a20e0dbaa1
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Apr 18 18:38:20 2014 -0400

    pointer: Merge update_current_focus and repick_for_event
    
    In order to correctly fix the issue to make sure we only set the
    focused surface to NULL during a grab, but not the current surface,
    we need to merge update_current_surface back into repick_for_event
    so we have more control over the behavior here.

 src/wayland/meta-wayland-pointer.c |   36 +++++++++++++-----------------------
 1 files changed, 13 insertions(+), 23 deletions(-)
---
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index a7b5eb0..f19e52a 100644
--- a/src/wayland/meta-wayland-pointer.c
+++ b/src/wayland/meta-wayland-pointer.c
@@ -353,22 +353,6 @@ count_buttons (const ClutterEvent *event)
 }
 
 static void
-update_current_focus (MetaWaylandPointer *pointer,
-                      MetaWaylandSurface *surface)
-{
-  pointer->current = surface;
-
-  if (pointer->cursor_tracker && surface == NULL)
-    meta_cursor_tracker_unset_window_cursor (pointer->cursor_tracker);
-
-  if (surface != pointer->focus_surface)
-    {
-      const MetaWaylandPointerGrabInterface *interface = pointer->grab->interface;
-      interface->focus (pointer->grab, surface);
-    }
-}
-
-static void
 repick_for_event (MetaWaylandPointer *pointer,
                   const ClutterEvent *for_event)
 {
@@ -376,12 +360,6 @@ repick_for_event (MetaWaylandPointer *pointer,
   MetaWaylandSurface *surface = NULL;
   MetaDisplay        *display = meta_get_display ();
 
-  if (meta_grab_op_should_block_wayland (display->grab_op))
-    {
-      update_current_focus (pointer, NULL);
-      return;
-    }
-
   if (for_event)
     {
       actor = clutter_event_get_source (for_event);
@@ -403,7 +381,19 @@ repick_for_event (MetaWaylandPointer *pointer,
   if (META_IS_SURFACE_ACTOR_WAYLAND (actor))
     surface = meta_surface_actor_wayland_get_surface (META_SURFACE_ACTOR_WAYLAND (actor));
 
-  update_current_focus (pointer, surface);
+  if (meta_grab_op_should_block_wayland (display->grab_op))
+    surface = NULL;
+
+  pointer->current = surface;
+
+  if (pointer->cursor_tracker && surface == NULL)
+    meta_cursor_tracker_unset_window_cursor (pointer->cursor_tracker);
+
+  if (surface != pointer->focus_surface)
+    {
+      const MetaWaylandPointerGrabInterface *interface = pointer->grab->interface;
+      interface->focus (pointer->grab, surface);
+    }
 }
 
 static void


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