aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-06-02 20:50:54 +0200
committerAlexander Orzechowski <alex@ozal.ski>2023-06-02 22:33:40 +0000
commit09c87cec3f0ea779717e38b3b886ef9a93840339 (patch)
tree6e28d257cf4fae6fc0964f3383992422fdf930fe
parent8c0eeb6a86d858a87f4839db4d551817136753c7 (diff)
cursor: fix wl_pointer.set_cursor hotspot updates
A client might update the cursor with the same wl_surface as before, but with a different hotspot. Don't ignore such updates. Fixes: 9c9e3f626350 ("cursor: ignore wlr_cursor_set_surface() with same surface")
-rw-r--r--types/wlr_cursor.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/types/wlr_cursor.c b/types/wlr_cursor.c
index fdb40a72..a3cf5183 100644
--- a/types/wlr_cursor.c
+++ b/types/wlr_cursor.c
@@ -463,7 +463,9 @@ void wlr_cursor_set_surface(struct wlr_cursor *cur, struct wlr_surface *surface,
struct wlr_cursor_output_cursor *output_cursor;
wl_list_for_each(output_cursor, &cur->state->output_cursors, link) {
- if (surface == output_cursor->surface) {
+ if (surface == output_cursor->surface &&
+ hotspot_x == output_cursor->surface_hotspot.x &&
+ hotspot_y == output_cursor->surface_hotspot.y) {
continue;
}