Skip to content

Commit

Permalink
user32/tests: Return MA_ACTIVATE to WM_MOUSEACTIVATE on main test win…
Browse files Browse the repository at this point in the history
…dow.

This shows that one of test_SetWindowPos is broken on Wine, and needs
to be fixed. It was previously fixed by some change in DefWindowProcA,
introduced in 71d35d8 but that was a
unexpected side effect.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
  • Loading branch information
rbernon authored and julliard committed Dec 26, 2019
1 parent f6d671c commit 6c47355
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions dlls/user32/tests/win.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,8 @@ static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR
if (wparam) app_activated = TRUE;
else app_deactivated = TRUE;
break;
case WM_MOUSEACTIVATE:
return MA_ACTIVATE;
}

return DefWindowProcA(hwnd, msg, wparam, lparam);
Expand Down Expand Up @@ -2717,7 +2719,7 @@ static void test_SetWindowPos(HWND hwnd, HWND hwnd2)
ret = SetWindowPos(hwnd_child, NULL, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_SHOWWINDOW);
ok(ret, "Got %d\n", ret);
flush_events( TRUE );
check_active_state(hwnd2, hwnd2, hwnd2);
todo_wine check_active_state(hwnd2, hwnd2, hwnd2);
DestroyWindow(hwnd_child);
}

Expand Down Expand Up @@ -3371,8 +3373,12 @@ static void test_SetForegroundWindow(HWND hwnd)

while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
if (0) check_wnd_state(hwnd2, hwnd2, hwnd2, 0);
ok(GetActiveWindow() == hwnd2, "Expected active window %p, got %p.\n", hwnd2, GetActiveWindow());
ok(GetFocus() == hwnd2, "Expected focus window %p, got %p.\n", hwnd2, GetFocus());

/* FIXME: these tests are failing because of a race condition
* between internal focus state applied immediately and X11 focus
* message coming late */
todo_wine ok(GetActiveWindow() == hwnd2, "Expected active window %p, got %p.\n", hwnd2, GetActiveWindow());
todo_wine ok(GetFocus() == hwnd2, "Expected focus window %p, got %p.\n", hwnd2, GetFocus());

SetForegroundWindow(hwnd);
check_wnd_state(hwnd, hwnd, hwnd, 0);
Expand Down

0 comments on commit 6c47355

Please sign in to comment.