From 6c782251608e4f399d115af0d5c302f192e31df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 22 May 2025 11:43:18 +0200 Subject: [PATCH] xwayland: Activate no_focus_window when a Wayland window is activated None active window might be interpreted from an X point of view as a transient focus state, and is used by multiple X window managers when a temporary focus change is in progress, or simply when grabbing the keyboard. From Wine side, we translate any active window change to the Win32 application, and handling None active window as an actual window deactivation and focus loss creates spurious events and an undesired feedback loop, as apps might react to it. We still want to be able to detect actual focus loss under an XWayland session, and having XWayland window manager focus an actual X window instead will make the distinction possible. --- xwayland/xwm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 953906fa8..0225a0d05 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -441,7 +441,7 @@ static void xwm_set_focused_window(struct wlr_xwm *xwm, xsurface_set_net_wm_state(xsurface); xwm_set_net_active_window(xwm, xsurface->window_id); } else { - xwm_set_net_active_window(xwm, XCB_WINDOW_NONE); + xwm_set_net_active_window(xwm, xwm->no_focus_window); } }