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).
This commit is contained in:
lkn 2026-06-25 07:50:19 +02:00
parent 140d120718
commit db96843a2f
1 changed files with 5 additions and 0 deletions

View File

@ -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; }