From c3198080fc6cc78ffb07849dd31b90980b16222a Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Thu, 16 Apr 2026 16:39:33 +0200 Subject: [PATCH] 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 8cb078f8b6be8f53d3ad53b74325b5369b90c704. 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 Part-of: --- hw/xwayland/xwayland-input.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index 397e95421..2dc3fd234 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -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)