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 <ofourdan@redhat.com>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Olivier Fourdan 2020-04-30 13:55:42 +02:00
parent 1345f804a8
commit baa8d12e46

View File

@ -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