[PATCH 0/1] MR6821: d3d9/tests: Flush events after minimizing and restoring focus window.
Minimizing the window might trigger a focus change to the dummy window, while restoring and setting foreground should change the foreground back to the focus window. However, the X window manager will instead send WM_TAKE_FOCUS event to the dummy window and to the focus window concurrently, and the dummy window might reply to it *after* we've restored the foreground to the focus window. This will later cause the device window to fail to get foreground, and the tests to randomly fail. (This works around a foreground window race condition that will be difficult to fix otherwise, as it can happen in a cross-process context as well) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6821
From: Rémi Bernon <rbernon(a)codeweavers.com> Minimizing the window might trigger a focus change to the dummy window, while restoring and setting foreground should change the foreground back to the focus window. However, the X window manager will instead send WM_TAKE_FOCUS event to the dummy window and to the focus window concurrently, and the dummy window might reply to it *after* we've restored the foreground to the focus window. This will later cause the device window to fail to get foreground, and the tests to randomly fail. --- dlls/d3d9/tests/d3d9ex.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/d3d9/tests/d3d9ex.c b/dlls/d3d9/tests/d3d9ex.c index 06105c25d66..f65996a8ed1 100644 --- a/dlls/d3d9/tests/d3d9ex.c +++ b/dlls/d3d9/tests/d3d9ex.c @@ -3145,7 +3145,9 @@ static void test_wndproc(void) * immediately restores the device on activation. There are plenty of WM_WINDOWPOSCHANGED * messages that are generated by ShowWindow, so testing for their absence is pointless. */ ShowWindow(focus_window, SW_MINIMIZE); + flush_events(); ShowWindow(focus_window, SW_RESTORE); + flush_events(); SetForegroundWindow(focus_window); flush_events(); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6821
This merge request was approved by Elizabeth Figura. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6821
This merge request was approved by Jan Sikorski. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6821
participants (3)
-
Elizabeth Figura (@zfigura) -
Jan Sikorski (@jsikorski) -
Rémi Bernon