user32/tests: Wait and flush messages after window creation.

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 <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2019-11-05 13:46:51 +01:00 committed by Alexandre Julliard
parent 71d35d8940
commit 9099b9843f

View file

@ -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;