diff --git a/src/backend/wayland/wl_pointer_motion.c b/src/backend/wayland/wl_pointer_motion.c index 0bd1a83..5a1ab25 100644 --- a/src/backend/wayland/wl_pointer_motion.c +++ b/src/backend/wayland/wl_pointer_motion.c @@ -15,6 +15,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_grab_apply_motion(void); void wl_update_pointer_focus(uint32_t time_msec); WMScreen *wl_get_wmscreen(void); @@ -151,6 +152,13 @@ handle_pointer_motion(struct wl_listener *listener, void *data) W_WL_EnqueueEvent(wmscr, &cev, mtarget); } wl_state.last_hovered_view = mtarget; + /* Apply the new view's cursor shape */ + if (mtarget && mtarget->cursor && W_SetCursorImageFn) { + const char *cname = (const char *)(uintptr_t)mtarget->cursor; + W_SetCursorImageFn(cname); + } else if (W_SetCursorImageFn) { + W_SetCursorImageFn("left_ptr"); + } } /* Emit synthetic LEAVE/ENTER when pointer crosses WM sub-window * boundaries (titlebar ↔ button, etc.). These feed the inner