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.
This commit is contained in:
Rémi Bernon 2025-05-22 11:43:18 +02:00 committed by Simon Ser
parent 83a5bdf5d5
commit 6c78225160

View file

@ -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);
}
}