summaryrefslogtreecommitdiff
path: root/gdk/wayland
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2018-05-09 22:13:10 +0200
committerJonas Ådahl <jadahl@gmail.com>2018-05-09 22:17:03 +0200
commita5d000cb5ca59fabc35e9a9c033f47ed5814a269 (patch)
treebef0c6773516be9196a25a49f2161cbf7b58be20 /gdk/wayland
parent47872e517224264a30e4ae33a7f3c103361bb82a (diff)
downloadgtk+-a5d000cb5ca59fabc35e9a9c033f47ed5814a269.tar.gz
wayland: Fix restarting cursor animation
When an animated cursor was set and the previous cursor animation delay happened to be the same, we wouldn't restart the animation timeout and just return G_SOURCE_CONTINUE assuming the timer would continue. This assumption is however only valid if the function was called from the timeout, which is not the case. Instead also arm the timer also if there is no previous timer active.
Diffstat (limited to 'gdk/wayland')
-rw-r--r--gdk/wayland/gdkdevice-wayland.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index edeb32f283..fc7019b8a8 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -405,13 +405,16 @@ gdk_wayland_device_update_surface_cursor (GdkDevice *device)
else
{
pointer->cursor_timeout_id = 0;
- return TRUE;
+ return G_SOURCE_REMOVE;
}
if (tablet)
{
if (!tablet->current_tool)
- return retval;
+ {
+ pointer->cursor_timeout_id = 0;
+ return G_SOURCE_REMOVE;
+ }
zwp_tablet_tool_v2_set_cursor (tablet->current_tool->wp_tablet_tool,
pointer->enter_serial,
@@ -426,7 +429,10 @@ gdk_wayland_device_update_surface_cursor (GdkDevice *device)
x, y);
}
else
- return retval;
+ {
+ pointer->cursor_timeout_id = 0;
+ return G_SOURCE_REMOVE;
+ }
if (buffer)
{
@@ -450,7 +456,8 @@ gdk_wayland_device_update_surface_cursor (GdkDevice *device)
if (next_image_index != pointer->cursor_image_index)
{
- if (next_image_delay != pointer->cursor_image_delay)
+ if (next_image_delay != pointer->cursor_image_delay ||
+ pointer->cursor_timeout_id == 0)
{
guint id;