From: Stefan Dösinger stefan@codeweavers.com
d3d8 is not affected in this way because it does not call flush_events() between focus loss and re-gain. --- dlls/d3d9/tests/device.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 0d38f68bf3f..2948d030d12 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -4228,10 +4228,24 @@ static void test_wndproc(void) } flush_events();
+ if (!(tests[i].create_flags & CREATE_DEVICE_NOWINDOWCHANGES)) + { + /* The window manager on Gitlab CI (FVWM2) insists on restoring the device window for some + * reason. In this case we might not receive WM_WINDOWPOSCHANGING on the device window + * because nothing is being changed on focus gain. Don't bother checking for messages in + * this case - depending on FVWM2's mood (and most likely the location of the mouse pointer, + * thanks to focus follows mouse) we may be activated or deactivated one or more times. + * + * Wine's internal status is being updated while processing messages (the flush_events above). */ + ret = IsIconic(device_window); + todo_wine_if (!ret) + ok(ret, "Expected the device window to still be iconic.\n"); + } + /* I have to minimize and restore the focus window, otherwise native d3d9 fails * device::reset with D3DERR_DEVICELOST. This does not happen when the window * restore is triggered by the user. */ - expect_messages = tests[i].reactivate_messages; + expect_messages = ret ? tests[i].reactivate_messages : NULL; ShowWindow(focus_window, SW_MINIMIZE); ShowWindow(focus_window, SW_RESTORE); /* Set focus twice to make KDE and fvwm in focus-follows-mouse mode happy. */ @@ -4239,8 +4253,11 @@ static void test_wndproc(void) flush_events(); SetForegroundWindow(focus_window); flush_events(); /* WM_WINDOWPOSCHANGING etc arrive after SetForegroundWindow returns. */ - ok(!expect_messages->message, "Expected message %#x for window %#x, but didn't receive it, i=%u.\n", - expect_messages->message, expect_messages->window, i); + if (expect_messages) + { + ok(!expect_messages->message, "Expected message %#x for window %#x, but didn't receive it, i=%u.\n", + expect_messages->message, expect_messages->window, i); + } expect_messages = NULL;
hr = IDirect3DDevice9_TestCooperativeLevel(device);