Revert "xwayland: Do not pretend leaving the X11 surface if buttons are down"

Kwin may send button events to Xwayland even when there is no Xwayland
surface with input focus.

With this change applied, that causes spurious input focus changes.

And even with that change reverted, I fail to reproduce the bug from
issue #1811.

This reverts commit 8cb078f8b6.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/work_items/1883
See-also: https://gitlab.freedesktop.org/xorg/xserver/-/work_items/1811
See-also: https://gitlab.freedesktop.org/xorg/xserver/-/work_items/1818
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2194>
This commit is contained in:
Olivier Fourdan 2026-04-16 16:39:33 +02:00 committed by Marge Bot
parent d6c462f599
commit c3198080fc

View file

@ -3268,15 +3268,6 @@ sprite_check_lost_focus(SpritePtr sprite, WindowPtr window)
if (master->lastSlave != get_pointer_device(xwl_seat))
return FALSE;
/* If we left the surface with a button down, it means the wayland compositor
* has grabbed the pointer so we will not get button release events from the
* compositor, so leave the window processing untouched, so that we do not
* end up with the wrong cursor, for example, when processing events once
* the pointer enters the X11 surface again.
*/
if (master->button->buttonsDown)
return FALSE;
if (xwl_seat->focus_window != NULL &&
xwl_seat->cursor_confinement_window != NULL &&
xwl_seat->focus_window != xwl_seat->cursor_confinement_window)