This reverts commit b1f74bc20d75592217add533f4630e163ec76075.
Although this was thoroughly tested on Mutter and Kwin with Proton, @alesliehughes reported some issues with it breaking Steam for Windows under some setup, and test results from tonight seem to indicate that it also triggers undesired focus changes, when foreground is only transient and about to change to another window, with Openbox and Fvwm:
https://test.winehq.org/data/8f91df4c4e4fb8b32c737bb02e82dcddfb71a114/linux_... https://test.winehq.org/data/8f91df4c4e4fb8b32c737bb02e82dcddfb71a114/linux_...
The problem is that Openbox is not developed anymore, so it is hopeless to imagine changing anything there. And the Fvwm version used in the testbot is `fvwm2`, in a similar development state, although we might decide to switch to a more recent fvwm3 later on it has its own issues as the `linux_rbernon-x11-trixie` test VMs show.
Under XWayland, the only indication that a Wayland window is being focused is `_NET_ACTIVE_WINDOW = None`/FocusOut event, which are indistinguishable from these transient focus changes.
I'm now trying to make some changes on XWayland WM side, by focusing the root window instead so we can tell the difference, but it's not clear whether this will be well received or not for the moment:
* https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/1761 * https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/5076 * https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4447 * https://invent.kde.org/plasma/kwin/-/merge_requests/7664
In the meantime we should probably revert this in order to fix the regression and avoid introducing spurious failures again.
From: Rémi Bernon rbernon@codeweavers.com
This reverts commit b1f74bc20d75592217add533f4630e163ec76075. --- dlls/winex11.drv/window.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 683c8037f9b..c6decf4796d 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -354,7 +354,8 @@ static HWND hwnd_from_window( Display *display, Window window ) HWND *list; UINT i;
- if (!window || window == root_window) return desktop; + if (!window) return 0; + if (window == root_window) return desktop; if (!XFindContext( display, window, winContext, (char **)&hwnd )) return hwnd;
if (!(list = build_hwnd_list())) return desktop;