From 763dc064504d729029f227e220c858fdb8a8178e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Wed, 6 Sep 2023 14:40:52 +0300 Subject: [PATCH] d3d8/tests: Don't check messages when doing the minimization workaround dance. --- dlls/d3d8/tests/device.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index ec6f2ce51b3..b61ad207cc9 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -3203,9 +3203,15 @@ static void test_wndproc(void) /* I have to minimize and restore the focus window, otherwise native d3d8 fails * device::reset with D3DERR_DEVICELOST. This does not happen when the window - * restore is triggered by the user. */ + * restore is triggered by the user. + * + * fvwm randomly sends a focus loss notification when we minimize, so do it + * before checking the incoming messages. It might match WM_ACTIVATEAPP but has + * a wrong WPARAM. Use SW_SHOWMINNOACTIVE to make sure we don't accidentally + * activate the window at this point and miss our WM_ACTIVATEAPP(wparam=1). */ + ShowWindow(focus_window, SW_SHOWMINNOACTIVE); + flush_events(); expect_messages = reactivate_messages; - ShowWindow(focus_window, SW_MINIMIZE); ShowWindow(focus_window, SW_RESTORE); /* Set focus twice to make KDE and fvwm in focus-follows-mouse mode happy. */ SetForegroundWindow(focus_window);