[gtk+] wayland: Keep the last cursor on leave, try to restore it on enter



commit 2c71b8f5991c98d3beb2df2f19ea2edad52e858c
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Sep 1 18:53:00 2014 +0200

    wayland: Keep the last cursor on leave, try to restore it on enter
    
    On DnD, pointer_handle_leave may be triggered without the pointer actually
    leaving the window, and pointer_handle_enter() happening after intra-window
    DnD won't actually manage to update the cursor (it does nothing directly,
    and to the upper layers the cursor is still the same and consistent, so no
    attempt will happen).
    
    To fix this, keep the pointer cursor on leave, and ensure it is updated
    on enter. The pointer cursor will be updated to any current new one through
    the enter/motion events generated if it needs be.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=735831

 gdk/wayland/gdkdevice-wayland.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 4e77317..d6dafee 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -684,6 +684,8 @@ pointer_handle_enter (void              *data,
   event->crossing.focus = TRUE;
   event->crossing.state = 0;
 
+  gdk_wayland_device_update_window_cursor (device);
+
   get_coordinates (device,
                    &event->crossing.x,
                    &event->crossing.y,
@@ -728,6 +730,8 @@ pointer_handle_leave (void              *data,
   event->crossing.focus = TRUE;
   event->crossing.state = 0;
 
+  gdk_wayland_device_update_window_cursor (device);
+
   get_coordinates (device,
                    &event->crossing.x,
                    &event->crossing.y,
@@ -742,11 +746,7 @@ pointer_handle_leave (void              *data,
 
   g_object_unref(device->pointer_focus);
   if (device->cursor)
-    {
-      gdk_wayland_device_stop_window_cursor_animation (device);
-      g_object_unref (device->cursor);
-      device->cursor = NULL;
-    }
+    gdk_wayland_device_stop_window_cursor_animation (device);
 
   device->pointer_focus = NULL;
 }


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