From 9099b9843f048565b8bc5b3ee084df55956c5bf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Tue, 5 Nov 2019 13:46:51 +0100 Subject: [PATCH] user32/tests: Wait and flush messages after window creation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The window created in the separate thread in test_Input_mouse sometimes fails to catch the mouse input in time. Waiting and flushing the initial messages seems to make the issue harder to reproduce. Signed-off-by: RĂ©mi Bernon Signed-off-by: Alexandre Julliard --- dlls/user32/tests/input.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 1e6be311eeb..d0e76038115 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -2196,6 +2196,7 @@ static DWORD WINAPI create_static_win(void *arg) { struct thread_data *thread_data = arg; HWND win; + MSG msg; win = CreateWindowA("static", "static", WS_VISIBLE | WS_POPUP, 100, 100, 100, 100, 0, NULL, NULL, NULL); @@ -2204,6 +2205,7 @@ static DWORD WINAPI create_static_win(void *arg) GWLP_WNDPROC, (LONG_PTR)static_hook_proc); thread_data->win = win; + while (wait_for_message(&msg)) DispatchMessageA(&msg); SetEvent(thread_data->start_event); wait_for_event(thread_data->end_event, 5000); return 0;