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 commit is contained in:
Rémi Bernon 2024-11-15 13:16:18 +01:00 committed by Alexandre Julliard
parent 8923eb51ea
commit 7b58ce5a02
Notes: Alexandre Julliard 2024-11-19 23:23:19 +01:00
Approved-by: Jan Sikorski (@jsikorski)
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/wine/merge_requests/6821

View file

@ -3145,7 +3145,9 @@ static void test_wndproc(void)
* immediately restores the device on activation. There are plenty of WM_WINDOWPOSCHANGED * 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. */ * messages that are generated by ShowWindow, so testing for their absence is pointless. */
ShowWindow(focus_window, SW_MINIMIZE); ShowWindow(focus_window, SW_MINIMIZE);
flush_events();
ShowWindow(focus_window, SW_RESTORE); ShowWindow(focus_window, SW_RESTORE);
flush_events();
SetForegroundWindow(focus_window); SetForegroundWindow(focus_window);
flush_events(); flush_events();