From db96843a2f9a4950d13937cd0490baf224ffc36c Mon Sep 17 00:00:00 2001 From: lkn Date: Thu, 25 Jun 2026 07:50:19 +0200 Subject: [PATCH] wayland: reset cursor to left_ptr when entering frame decorations When the pointer moves over WM frame_bufs (titlebar, resizebar, buttons), reset the cursor image to left_ptr. Without this, the cursor stayed as whatever the last client set it to (e.g. text beam from a text editor). --- src/backend/wayland/wl_pointer_motion.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/backend/wayland/wl_pointer_motion.c b/src/backend/wayland/wl_pointer_motion.c index 9a36d72..853fbf9 100644 --- a/src/backend/wayland/wl_pointer_motion.c +++ b/src/backend/wayland/wl_pointer_motion.c @@ -16,6 +16,7 @@ /* Forward declarations for functions defined in other wl_*.c files */ void W_WL_EnqueueEvent(struct W_Screen *scr, const WMEvent *ev, struct W_View *target); extern void (*W_SetCursorImageFn)(const char *name); +void wl_set_cursor_image(const char *name); void wl_view_destroyed_hook(struct W_View *v) { @@ -194,6 +195,8 @@ handle_pointer_motion(struct wl_listener *listener, void *data) xev.u.crossing.detail = WM_NOTIFY_ANCESTOR; W_WL_EnqueueEvent(wmscr, &xev, NULL); wl_state.last_hovered_id = new_id; + if (new_id) + wl_set_cursor_image("left_ptr"); } } if (wl_state.grab_type) { wl_grab_apply_motion(); return; } @@ -292,6 +295,8 @@ handle_pointer_motion_absolute(struct wl_listener *listener, void *data) xev.u.crossing.detail = WM_NOTIFY_ANCESTOR; W_WL_EnqueueEvent(wmscr2, &xev, NULL); wl_state.last_hovered_id = new_id; + if (new_id) + wl_set_cursor_image("left_ptr"); } } if (wl_state.grab_type) { wl_grab_apply_motion(); return; }