From 7fcfb0870dc9c13b6a096402d71ed97c03368f67 Mon Sep 17 00:00:00 2001 From: Ollie Date: Fri, 29 May 2026 08:39:36 +0200 Subject: [PATCH] =?UTF-8?q?wl=5Fbackend:=20stop=20resetting=20cursor=20to?= =?UTF-8?q?=20left=5Fptr=20on=20every=20surface=20enter=20=E2=80=94=20let?= =?UTF-8?q?=20clients=20set=20their=20own=20cursor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/wayland/wl_backend.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/backend/wayland/wl_backend.c b/src/backend/wayland/wl_backend.c index 7d48dec..1967f0b 100644 --- a/src/backend/wayland/wl_backend.c +++ b/src/backend/wayland/wl_backend.c @@ -6430,14 +6430,13 @@ wl_update_pointer_focus(uint32_t time_msec) wl_state.pointer_x, wl_state.pointer_y, &sx, &sy, &view); } - /* Don't reset cursor during an active WM policy grab (move/resize) — - * pointer_change_grab manages the cursor during these operations. */ + /* Track last focused surface for cursor reset on focus leave. + * We do NOT reset to left_ptr on enter — the client sets its own + * cursor via wl_pointer.set_cursor (handle_seat_request_cursor). */ static struct wlr_surface *last_focused_surface = NULL; if (surface) { if (surface != last_focused_surface) { last_focused_surface = surface; - if (!wl_state.grab_type) - wl_set_cursor_image("left_ptr"); } wlr_seat_pointer_notify_enter(wl_state.seat, surface, sx, sy); wlr_seat_pointer_notify_motion(wl_state.seat, time_msec, sx, sy); @@ -6447,8 +6446,8 @@ wl_update_pointer_focus(uint32_t time_msec) last_focused_surface = NULL; } wlr_seat_pointer_clear_focus(wl_state.seat); - /* Restore WM cursor — the client may have set its own cursor - * surface which becomes invalid once pointer focus leaves. */ + /* Restore WM cursor when pointer leaves all surfaces. + * Don't reset during grabs — pointer_change_grab manages that. */ if (!wl_state.grab_type) wl_set_cursor_image("left_ptr"); }