From 2c71b8f5991c98d3beb2df2f19ea2edad52e858c Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 1 Sep 2014 18:53:00 +0200 Subject: [PATCH] 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 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c index 4e773179c2..d6dafeec69 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; }