[mutter] pointer: Unset the window cursor when we do a pick



commit de7a644656aee1ebae39b781a8f6ef419d64226b
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Apr 18 18:32:50 2014 -0400

    pointer: Unset the window cursor when we do a pick
    
    ... not when we do an update.
    
    We only repick when we handle events, not when we update. Perhaps
    this is a mistake.
    
    Since update runs before handle_event, this means that when we
    drop a grab, update will notice the NULL surface, since we haven't
    repicked after the event, and then we'll repick the correct surface.
    The end result is that you see a root cursor after a grab ends,
    rather than the correct window cursor.
    
    This doesn't fix it, since the current surface becomes NULL when
    we start the grab. But it does make the code here more correct when
    we fix that bug.

 src/wayland/meta-wayland-pointer.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index 86aa807..a7b5eb0 100644
--- a/src/wayland/meta-wayland-pointer.c
+++ b/src/wayland/meta-wayland-pointer.c
@@ -357,6 +357,10 @@ 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;
@@ -534,9 +538,6 @@ meta_wayland_pointer_update (MetaWaylandPointer *pointer,
 
       clutter_input_device_get_coords (pointer->device, NULL, &pos);
       meta_cursor_tracker_update_position (pointer->cursor_tracker, pos.x, pos.y);
-
-      if (pointer->current == NULL)
-        meta_cursor_tracker_unset_window_cursor (pointer->cursor_tracker);
     }
 }
 


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