From 4cd8afa83eaa37c1400a3474aa6a111665f8aaef Mon Sep 17 00:00:00 2001 From: Consolatis <35009135+Consolatis@users.noreply.github.com> Date: Tue, 28 Mar 2023 00:58:42 +0200 Subject: [PATCH] src/cursor.c: fix invisible cursor on output loss / restore Previously, the cursor image was only updated on output loss when the cursor was on a labwc owned surface. This patch forces a re-enter of a client surface in the remaining case of cursor being over a non-labwc surface which causes the client to re-set its own cursor image. This fixes a regression caused by 4dc99e2f3856650f3b61778f015a823cfae978d2. Thanks to @Flrian for finding the root cause of the issue. Fixes #820 Reported-by: @Flrian Tested-by: @Flrian --- src/cursor.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cursor.c b/src/cursor.c index 2255a5ec..2ce8e293 100644 --- a/src/cursor.c +++ b/src/cursor.c @@ -260,6 +260,16 @@ cursor_update_image(struct seat *seat) { enum lab_cursors cursor = seat->server_cursor; if (cursor == LAB_CURSOR_CLIENT) { + /* + * When we loose the output cursor while over a client + * surface (e.g. output was destroyed and we now deal with + * a new output instance), we have to force a re-enter of + * the surface so the client sets its own cursor again. + */ + if (seat->seat->pointer_state.focused_surface) { + seat->server_cursor = LAB_CURSOR_DEFAULT; + cursor_update_focus(seat->server); + } return; } wlr_xcursor_manager_set_cursor_image(