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

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 <ofourdan@redhat.com>
Closes: xorg/xserver#962Reviewed-by: Carlos Garnacho's avatarCarlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
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)
xwl_seat_destroy_confined_pointer(xwl_seat);
......
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