wayland: fix pointer warp using wlr_cursor_warp_closest

wlr_cursor_warp with NULL device silently fails (returns false) if the
target coordinates fall outside the output layout bounds. This made
pointer warping appear completely broken.

Switch to wlr_cursor_warp_closest which clamps to the nearest valid
point on the output layout, ensuring the cursor always moves.
This commit is contained in:
lkn 2026-06-25 07:12:57 +02:00
parent ab933c6565
commit 1ef79265e7
1 changed files with 1 additions and 1 deletions

View File

@ -268,7 +268,7 @@ void
wl_pointer_warp_to(int x, int y) wl_pointer_warp_to(int x, int y)
{ {
if (wl_state.cursor) { if (wl_state.cursor) {
wlr_cursor_warp(wl_state.cursor, NULL, (double)x, (double)y); wlr_cursor_warp_closest(wl_state.cursor, NULL, (double)x, (double)y);
wl_state.pointer_x = (int)wl_state.cursor->x; wl_state.pointer_x = (int)wl_state.cursor->x;
wl_state.pointer_y = (int)wl_state.cursor->y; wl_state.pointer_y = (int)wl_state.cursor->y;
} else { } else {