From 70a6c61bf0f8ea14b659bcae4cb0864f009434cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Wed, 26 Feb 2025 11:28:38 +0100 Subject: [PATCH] xwayland: Allow pointer warps even when cursor is visible. This fixes XWarpPointer being no-op on XWayland even when the cursor is within the focused window surface. This is something that works with X server, and Wine expects that to implement Windows SetCursorPos for many games. Using zwp_locked_pointer_v1 should already make sure we're not warping pointer when outside of the focused window surface. --- hw/xwayland/xwayland-input.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index 35905829e5..825834fbab 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -3503,9 +3503,6 @@ xwl_seat_emulate_pointer_warp(struct xwl_seat *xwl_seat, if (!xwl_seat_can_emulate_pointer_warp(xwl_seat)) return; - if (xwl_seat->x_cursor != NULL) - return; - if (!xwl_seat->pointer_warp_emulator) xwl_seat_create_pointer_warp_emulator(xwl_seat); @@ -3516,6 +3513,9 @@ xwl_seat_emulate_pointer_warp(struct xwl_seat *xwl_seat, xwl_window, sprite, x, y); + + if (xwl_seat->x_cursor != NULL) + xwl_seat_destroy_pointer_warp_emulator(xwl_seat); } static Bool -- GitLab