From 2c3f2449837f7b0d2e3cfd13223f2ac133bc45e7 Mon Sep 17 00:00:00 2001 From: lkn Date: Tue, 23 Jun 2026 23:51:32 +0200 Subject: [PATCH] ibeam: read attribs.cursor from view on hover --- src/backend/wayland/wl_pointer_motion.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/backend/wayland/wl_pointer_motion.c b/src/backend/wayland/wl_pointer_motion.c index 5a1ab25..4e67e61 100644 --- a/src/backend/wayland/wl_pointer_motion.c +++ b/src/backend/wayland/wl_pointer_motion.c @@ -152,12 +152,12 @@ 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; + /* Apply the new view's cursor (attribs.cursor set at widget creation) */ + if (W_SetCursorImageFn) { + WMNativeCursor c = mtarget ? mtarget->attribs.cursor : 0; + if (!c && mtarget) c = mtarget->cursor; + const char *cname = c ? (const char *)(uintptr_t)c : "left_ptr"; W_SetCursorImageFn(cname); - } else if (W_SetCursorImageFn) { - W_SetCursorImageFn("left_ptr"); } } /* Emit synthetic LEAVE/ENTER when pointer crosses WM sub-window