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
This commit is contained in:
Carlos Garnacho 2014-09-01 18:53:00 +02:00
parent a0abdbbdd6
commit 2c71b8f599

View File

@ -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;
}