Supercedes: 171968
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47945 Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Fix failed in in msg.c
dlls/user32/defwnd.c | 2 +- dlls/user32/tests/msg.c | 2 +- dlls/user32/tests/win.c | 35 ++++++++++++++++++++++++++++++++--- 3 files changed, 34 insertions(+), 5 deletions(-)
diff --git a/dlls/user32/defwnd.c b/dlls/user32/defwnd.c index c0d1190710..9cd1298923 100644 --- a/dlls/user32/defwnd.c +++ b/dlls/user32/defwnd.c @@ -409,7 +409,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa }
/* Caption clicks are handled by NC_HandleNCLButtonDown() */ - return MA_ACTIVATE; + return ( HIWORD(lParam) == WM_LBUTTONDOWN && LOWORD(lParam) == HTCAPTION ? MA_NOACTIVATE : MA_ACTIVATE );
case WM_ACTIVATE: /* The default action in Windows is to set the keyboard focus to diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 477661ab62..d2342c8b14 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -5163,7 +5163,7 @@ static void test_messages(void)
ShowWindow(hwnd, SW_MINIMIZE); flush_events(); - ok_sequence(WmShowMinOverlappedSeq, "ShowWindow(SW_SHOWMINIMIZED):overlapped", TRUE); + ok_sequence(WmShowMinOverlappedSeq, "ShowWindow(SW_SHOWMINIMIZED):overlapped", FALSE); flush_sequence();
if (GetWindowLongW( hwnd, GWL_STYLE ) & WS_MINIMIZE) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 784849b2ba..367d7300a1 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -2717,7 +2717,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 ); - todo_wine check_active_state(hwnd2, hwnd2, hwnd2); + check_active_state(hwnd2, hwnd2, hwnd2); DestroyWindow(hwnd_child); }
@@ -3371,8 +3371,8 @@ 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); - 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()); + ok(GetActiveWindow() == hwnd2, "Expected active window %p, got %p.\n", hwnd2, GetActiveWindow()); + ok(GetFocus() == hwnd2, "Expected focus window %p, got %p.\n", hwnd2, GetFocus());
SetForegroundWindow(hwnd); check_wnd_state(hwnd, hwnd, hwnd, 0); @@ -3965,6 +3965,35 @@ static void test_mouse_input(HWND hwnd) TEST_MOUSEACTIVATE(HTCLOSE,MA_ACTIVATE); TEST_MOUSEACTIVATE(HTHELP,MA_ACTIVATE);
+#define TEST_MOUSEACTIVATE2(A,B) \ + res = SendMessageA(hwnd, WM_MOUSEACTIVATE, (WPARAM)hwnd, (LPARAM)MAKELRESULT(A,WM_LBUTTONDOWN)); \ + ok(res == B, "WM_MOUSEACTIVATE for %s returned %ld\n", #A, res); + + TEST_MOUSEACTIVATE2(HTERROR,MA_ACTIVATE); + TEST_MOUSEACTIVATE2(HTTRANSPARENT,MA_ACTIVATE); + TEST_MOUSEACTIVATE2(HTNOWHERE,MA_ACTIVATE); + TEST_MOUSEACTIVATE2(HTCLIENT,MA_ACTIVATE); + TEST_MOUSEACTIVATE2(HTCAPTION,MA_NOACTIVATE); + TEST_MOUSEACTIVATE2(HTSYSMENU,MA_ACTIVATE); + TEST_MOUSEACTIVATE2(HTSIZE,MA_ACTIVATE); + TEST_MOUSEACTIVATE2(HTMENU,MA_ACTIVATE); + TEST_MOUSEACTIVATE2(HTHSCROLL,MA_ACTIVATE); + TEST_MOUSEACTIVATE2(HTVSCROLL,MA_ACTIVATE); + TEST_MOUSEACTIVATE2(HTMINBUTTON,MA_ACTIVATE); + TEST_MOUSEACTIVATE2(HTMAXBUTTON,MA_ACTIVATE); + TEST_MOUSEACTIVATE2(HTLEFT,MA_ACTIVATE); + TEST_MOUSEACTIVATE2(HTRIGHT,MA_ACTIVATE); + TEST_MOUSEACTIVATE2(HTTOP,MA_ACTIVATE); + TEST_MOUSEACTIVATE2(HTTOPLEFT,MA_ACTIVATE); + TEST_MOUSEACTIVATE2(HTTOPRIGHT,MA_ACTIVATE); + TEST_MOUSEACTIVATE2(HTBOTTOM,MA_ACTIVATE); + TEST_MOUSEACTIVATE2(HTBOTTOMLEFT,MA_ACTIVATE); + TEST_MOUSEACTIVATE2(HTBOTTOMRIGHT,MA_ACTIVATE); + TEST_MOUSEACTIVATE2(HTBORDER,MA_ACTIVATE); + TEST_MOUSEACTIVATE2(HTOBJECT,MA_ACTIVATE); + TEST_MOUSEACTIVATE2(HTCLOSE,MA_ACTIVATE); + TEST_MOUSEACTIVATE2(HTHELP,MA_ACTIVATE); + ShowWindow(popup, SW_HIDE);
/* Test sending double click to the non-client area, while capturing the window after