Rémi Bernon : user32/tests: Return MA_ACTIVATE to WM_MOUSEACTIVATE on main test window.

Alexandre Julliard julliard at winehq.org
Thu Dec 26 15:44:38 CST 2019


Module: wine
Branch: master
Commit: 6c47355006b1d9095ac0dedc612eafdb1cdd03f2
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6c47355006b1d9095ac0dedc612eafdb1cdd03f2

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Thu Dec 26 12:51:22 2019 +0100

user32/tests: Return MA_ACTIVATE to WM_MOUSEACTIVATE on main test window.

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 71d35d8940118bc6de6522913fb8c473fa5b2c24 but that was a
unexpected side effect.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/tests/win.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index 926234fa5d..bb4eebfd0f 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -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);
@@ -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);
 }
 
@@ -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);




More information about the wine-cvs mailing list