From df417b7e95fce515f85b20e180742bcc289e35d4 Mon Sep 17 00:00:00 2001 From: Mykola Orliuk Date: Sat, 3 Oct 2020 15:06:05 +0200 Subject: backend/wayland: manage cursor for current pointer --- backend/wayland/output.c | 5 +++-- backend/wayland/seat.c | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'backend') 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; -- cgit v1.2.3