diff options
author | Mykola Orliuk <virkony@gmail.com> | 2020-10-03 15:06:05 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-10-18 16:28:12 +0200 |
commit | df417b7e95fce515f85b20e180742bcc289e35d4 (patch) | |
tree | a50655db6d1bc323128b29769da307a23514b556 /backend | |
parent | b98522b38fa19c732e0bc420178b76b847460dfe (diff) |
backend/wayland: manage cursor for current pointer
Diffstat (limited to 'backend')
-rw-r--r-- | backend/wayland/output.c | 5 | ||||
-rw-r--r-- | backend/wayland/seat.c | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/backend/wayland/output.c b/backend/wayland/output.c index bd17fa20..b234c6a0 100644 --- a/backend/wayland/output.c +++ b/backend/wayland/output.c @@ -419,8 +419,9 @@ static void output_destroy(struct wlr_output *wlr_output) { } void update_wl_output_cursor(struct wlr_wl_output *output) { - if (output->backend->pointer && output->enter_serial) { - wl_pointer_set_cursor(output->backend->pointer, output->enter_serial, + struct wlr_wl_pointer *pointer = output->backend->current_pointer; + if (pointer && pointer->output == output && output->enter_serial) { + wl_pointer_set_cursor(pointer->wl_pointer, output->enter_serial, output->cursor.surface, output->cursor.hotspot_x, output->cursor.hotspot_y); } diff --git a/backend/wayland/seat.c b/backend/wayland/seat.c index a23a4c91..cce5c0dc 100644 --- a/backend/wayland/seat.c +++ b/backend/wayland/seat.c @@ -48,6 +48,7 @@ static void pointer_handle_enter(void *data, struct wl_pointer *wl_pointer, struct wlr_wl_output *output = wl_surface_get_user_data(surface); assert(output); struct wlr_wl_pointer *pointer = output_get_pointer(output); + assert(!backend->current_pointer || backend->current_pointer == pointer); output->enter_serial = serial; backend->current_pointer = pointer; |