From baa8d12e464664b5ad3c591be05a0087482790ca Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Thu, 30 Apr 2020 13:55:42 +0200 Subject: [PATCH] xwayland: Lock on entering surface if needed When an X11 client issues a ConfinePointer wit ha hidden cursor, Xwayland may translate that as a pointer lock. However, if the pointer is located on another window at the time, the request may be ignored, even if the pointer later enters the window. To avoid that issue, check again if locking the pointer with a hidden cursor is needed when pointer enters a surface. Signed-off-by: Olivier Fourdan Reviewed-by: Carlos Garnacho Reviewed-by: Peter Hutterer --- hw/xwayland/xwayland-input.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index 0ee84f6e3..fed78f70c 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -72,6 +72,9 @@ xwl_pointer_warp_emulator_maybe_lock(struct xwl_pointer_warp_emulator *warp_emul SpritePtr sprite, int x, int y); +static Bool +xwl_seat_maybe_lock_on_hidden_cursor(struct xwl_seat *xwl_seat); + static void xwl_seat_destroy_confined_pointer(struct xwl_seat *xwl_seat); @@ -447,6 +450,9 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer, xwl_seat->focus_window, NULL, 0, 0); } + else { + xwl_seat_maybe_lock_on_hidden_cursor(xwl_seat); + } } static void