Commit 5929b789 authored by Olivier Fourdan's avatar Olivier Fourdan
Browse files

xwayland: Do not lock the pointer on the wrong window

If a client issues a grab on the pointer while the cursor is on another
X11 window, and then hides the cursor, we may end up locking the pointer
onto that other window.

Then a button click might end up moving the focus away from the window
which issued the grab, leaving the whole setup in a mixed up state.

Typically, if the pointer is on another X11 window, we should not try to
lock the pointer, so that it can be moved back to the window which
actually issues the grab (and hence the pointer confinement). Typically,
this is the same as an X11 client issuing a pointer grab while the
cursor is on another Wayland native window.
Signed-off-by: default avatarOlivier Fourdan <>
Closes: xorg/xserver#962

Reviewed-by: Carlos Garnacho's avatarCarlos Garnacho <>
Reviewed-by: Peter Hutterer's avatarPeter Hutterer <>
parent a5151f58
......@@ -2817,6 +2817,9 @@ xwl_seat_maybe_lock_on_hidden_cursor(struct xwl_seat *xwl_seat)
if (!xwl_seat->focus_window)
return FALSE;
if (xwl_seat->cursor_confinement_window != xwl_seat->focus_window)
return FALSE;
if (xwl_seat->confined_pointer)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment