Making sure the X requests to activate the windows are being send and processed.
From: Rémi Bernon rbernon@codeweavers.com
Making sure the X requests to activate the windows are being send and processed. --- dlls/user32/tests/win.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 7d84bef71d7..1a8aa801df9 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -11226,6 +11226,7 @@ static DWORD WINAPI set_foreground_thread(void *params) { SetForegroundWindow(p->thread_window); check_wnd_state(p->thread_window, p->thread_window, p->thread_window, 0); + flush_events(TRUE); } if (msg.wParam & SET_FOREGROUND_INJECT) { @@ -11235,16 +11236,19 @@ static DWORD WINAPI set_foreground_thread(void *params) { SetForegroundWindow(p->window1); check_wnd_state(0, p->window1, 0, 0); + flush_events(TRUE); } if (msg.wParam & SET_FOREGROUND_STEAL_2) { SetForegroundWindow(p->thread_window); check_wnd_state(p->thread_window, p->thread_window, p->thread_window, 0); + flush_events(TRUE); } if (msg.wParam & SET_FOREGROUND_SET_2) { SetForegroundWindow(p->window2); check_wnd_state(0, p->window2, 0, 0); + flush_events(TRUE); }
SetEvent(p->command_executed); @@ -11280,7 +11284,7 @@ static void test_activateapp(HWND window1)
SetForegroundWindow(window1); check_wnd_state(window1, window1, window1, 0); - while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + flush_events(TRUE);
/* Steal foreground: WM_ACTIVATEAPP(0) is delivered. */ app_activated = app_deactivated = FALSE; @@ -11358,6 +11362,8 @@ static void test_activateapp(HWND window1) ok(app_deactivated, "Expected WM_ACTIVATEAPP(0), did not receive it.\n");
SetForegroundWindow(thread_params.thread_window); + check_wnd_state(0, thread_params.thread_window, 0, 0); + flush_events(TRUE);
/* Set foreground then remove: Both messages are delivered. */ app_activated = app_deactivated = FALSE; @@ -11381,10 +11387,8 @@ static void test_activateapp(HWND window1) todo_wine ok(app_deactivated, "Expected WM_ACTIVATEAPP(0), did not receive it.\n");
SetForegroundWindow(window1); - test_window = GetForegroundWindow(); - ok(test_window == window1, "Expected foreground window %p, got %p\n", - window1, test_window); check_wnd_state(window1, window1, window1, 0); + flush_events(TRUE);
/* Switch to a different window from the same thread? No messages. */ app_activated = app_deactivated = FALSE;