From b2cf6f5c2c8acbe3a4acdf052c3aec3b776e352e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 16 Nov 2022 16:56:36 +0100 Subject: [PATCH] uwac/input: Set the right serial when setting cursor The serial in wl_pointer.set_cursor must exactly match the one from wl_pointer.enter, it should not use whatever serial for any input class is the newest. --- uwac/libuwac/uwac-input.c | 3 ++- uwac/libuwac/uwac-priv.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/uwac/libuwac/uwac-input.c b/uwac/libuwac/uwac-input.c index 282618993..d0f3ada9f 100644 --- a/uwac/libuwac/uwac-input.c +++ b/uwac/libuwac/uwac-input.c @@ -729,6 +729,7 @@ static void pointer_handle_enter(void* data, struct wl_pointer* pointer, uint32_ } input->display->serial = serial; + input->display->pointer_focus_serial = serial; window = wl_surface_get_user_data(surface); if (window) window->pointer_enter_serial = serial; @@ -1191,5 +1192,5 @@ UwacReturnCode UwacSeatSetMouseCursor(UwacSeat* seat, const void* data, size_t l } if (seat && !seat->default_cursor) return UWAC_SUCCESS; - return set_cursor_image(seat, seat->display->serial); + return set_cursor_image(seat, seat->display->pointer_focus_serial); } diff --git a/uwac/libuwac/uwac-priv.h b/uwac/libuwac/uwac-priv.h index 6b991dd31..c4091fbfe 100644 --- a/uwac/libuwac/uwac-priv.h +++ b/uwac/libuwac/uwac-priv.h @@ -121,6 +121,7 @@ struct uwac_display bool running; UwacTask dispatch_fd_task; uint32_t serial; + uint32_t pointer_focus_serial; struct wl_list windows;