http://bugs.winehq.org/show_bug.cgi?id=59075
--- Comment #2 from Rémi Bernon rbernon@codeweavers.com --- It also happens only if you have a Wine console window in the background, for instance when running `wine start /d tests run-tests.exe System.Windows.Forms`.
When I run the tests with the Linux terminal output with `wine tests/run-tests.exe System.Windows.Forms` which only opens the test windows, they don't fail.
Which is kind of expected, as it's probably the console window getting foreground after some test closed all of its windows, and preventing more test windows to get active.
We don't have a very clever foreground process tracking, and we also activate other process ourselves from win32u when the active window is being hidden, with no current way to tell between this and a host / user focus change.
There's a similar regression on macOS where, unlike the Linux usual WM behavior, the host also isn't activating windows automatically when they become visible, and where it needs cooperation from the Wine side.
https://gitlab.winehq.org/wine/wine/-/merge_requests/9668 should fix this I think (and the macOS regression)