wl_backend: use correct cursor in wl_pointer_grab (not always left_ptr)

This commit is contained in:
Ollie 2026-05-29 08:26:28 +02:00
parent 2577050f44
commit 87ed6976a5
2 changed files with 14 additions and 3 deletions

View File

@ -75,7 +75,7 @@ XWayland bridge auto-syncs. Needs verification.
| `client_snapshot` | ✅ Done — buffer read for native, XGetImage for XWayland |
| `window_set_border` | ✅ No-op (borders drawn into frame buffer) |
| `client_synth_configure` | ✅ Done — XDG configure + XWayland configure |
| `pointer_change_grab` | ⚠️ No-op — menu tracking may need this |
| `pointer_change_grab` | ✅ Done — updates cursor during move/resize |
---

View File

@ -6293,8 +6293,19 @@ wl_pointer_grab(WNativeWindow grab_win, WNativeWindow confine_to,
if (wl_state.seat)
wlr_seat_pointer_clear_focus(wl_state.seat);
}
if (cursor_id > 0)
wl_set_cursor_image("left_ptr");
if (cursor_id > 0) {
/* Map WCUR_* cursor IDs to xcursor names (same as pointer_change_grab) */
switch (cursor_id) {
case WCUR_MOVE: wl_set_cursor_image("fleur"); break;
case WCUR_TOPLEFTRESIZE: wl_set_cursor_image("nw-resize"); break;
case WCUR_TOPRIGHTRESIZE: wl_set_cursor_image("ne-resize"); break;
case WCUR_BOTTOMLEFTRESIZE: wl_set_cursor_image("sw-resize"); break;
case WCUR_BOTTOMRIGHTRESIZE: wl_set_cursor_image("se-resize"); break;
case WCUR_VERTICALRESIZE: wl_set_cursor_image("n-resize"); break;
case WCUR_HORIZONRESIZE: wl_set_cursor_image("e-resize"); break;
default: wl_set_cursor_image("left_ptr"); break;
}
}
return 1; /* success */
}