summaryrefslogtreecommitdiff
path: root/src/input.c
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2015-03-18 15:08:03 +0800
committerJonas Ådahl <jadahl@gmail.com>2015-03-20 11:58:30 +0800
commitb407024ea18fe225f6db7ae01400f57abd7cf850 (patch)
tree8ee9db9eb134720fb1aa9871a09891bf482475dd /src/input.c
parenta86c3ee69727342873fb4cf218b4f6d3bb020e6c (diff)
input: Make setting the same pointer cursor state again a no-op
If the client calls wl_pointer.set_cursor with the same surface and hot spot coordinate that is already set, don't do anything as no state was changed. This avoids an issue where a client setting the same cursor surface multiple times would receive wl_surface.leave/enter on that surface every time. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Diffstat (limited to 'src/input.c')
-rw-r--r--src/input.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/input.c b/src/input.c
index 3867de22..469d5cee 100644
--- a/src/input.c
+++ b/src/input.c
@@ -1655,6 +1655,10 @@ pointer_set_cursor(struct wl_client *client, struct wl_resource *resource,
return;
}
+ if (pointer->sprite && pointer->sprite->surface == surface &&
+ pointer->hotspot_x == x && pointer->hotspot_y == y)
+ return;
+
if (pointer->sprite)
pointer_unmap_sprite(pointer);