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:
parent
ab933c6565
commit
1ef79265e7
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue