wl_backend: fix cursor reverting to arrow during opaque window drag

This commit is contained in:
Ollie 2026-05-30 09:07:57 +02:00
parent da9a62bf23
commit 39ba8d6794
1 changed files with 12 additions and 0 deletions

View File

@ -6540,6 +6540,18 @@ wl_pointer_change_grab(unsigned int event_mask, int cursor_id,
unsigned long timestamp) unsigned long timestamp)
{ {
(void)event_mask; (void)timestamp; (void)event_mask; (void)timestamp;
/* If no grab is active, start a WM policy grab (type 3) so that
* wl_update_pointer_focus doesn't reset the cursor on every motion
* event when the pointer is over frame decorations.
* This handles the opaque-move path where moveres.c calls
* pointer_change_grab without first calling pointer_grab. */
if (!wl_state.grab_type) {
wl_state.grab_type = 3;
wl_state.grab_view = NULL;
if (wl_state.seat)
wlr_seat_pointer_clear_focus(wl_state.seat);
wwarning("wl_backend: grab established via pointer_change_grab");
}
/* Map WCUR_* cursor IDs to xcursor names */ /* Map WCUR_* cursor IDs to xcursor names */
const char *name; const char *name;
switch (cursor_id) { switch (cursor_id) {