Supercedes: 171968
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47945 Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- dlls/user32/defwnd.c | 2 +- dlls/user32/tests/msg.c | 2 +- dlls/user32/tests/win.c | 60 +++++++++++++++++++++-------------------- 3 files changed, 33 insertions(+), 31 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..78dc55f00a 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); @@ -3936,34 +3936,36 @@ static void test_mouse_input(HWND hwnd) ok(peek_message(&msg), "no message available\n");
/* Test WM_MOUSEACTIVATE */ -#define TEST_MOUSEACTIVATE(A,B) \ +#define TEST_MOUSEACTIVATE(A,B,C) \ res = SendMessageA(hwnd, WM_MOUSEACTIVATE, (WPARAM)hwnd, (LPARAM)MAKELRESULT(A,0)); \ - ok(res == B, "WM_MOUSEACTIVATE for %s returned %ld\n", #A, res); + ok(res == B, "WM_MOUSEACTIVATE for %s returned %ld\n", #A, res); \ + res = SendMessageA(hwnd, WM_MOUSEACTIVATE, (WPARAM)hwnd, (LPARAM)MAKELRESULT(A,WM_LBUTTONDOWN)); \ + ok(res == C, "WM_MOUSEACTIVATE for %s returned %ld\n", #A, res);
- TEST_MOUSEACTIVATE(HTERROR,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTTRANSPARENT,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTNOWHERE,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTCLIENT,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTCAPTION,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTSYSMENU,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTSIZE,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTMENU,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTHSCROLL,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTVSCROLL,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTMINBUTTON,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTMAXBUTTON,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTLEFT,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTRIGHT,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTTOP,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTTOPLEFT,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTTOPRIGHT,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTBOTTOM,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTBOTTOMLEFT,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTBOTTOMRIGHT,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTBORDER,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTOBJECT,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTCLOSE,MA_ACTIVATE); - TEST_MOUSEACTIVATE(HTHELP,MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTERROR, MA_ACTIVATE, MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTTRANSPARENT, MA_ACTIVATE, MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTNOWHERE, MA_ACTIVATE, MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTCLIENT, MA_ACTIVATE, MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTCAPTION, MA_ACTIVATE, MA_NOACTIVATE); + TEST_MOUSEACTIVATE(HTSYSMENU, MA_ACTIVATE, MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTSIZE, MA_ACTIVATE, MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTMENU, MA_ACTIVATE, MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTHSCROLL, MA_ACTIVATE, MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTVSCROLL, MA_ACTIVATE, MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTMINBUTTON, MA_ACTIVATE, MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTMAXBUTTON, MA_ACTIVATE, MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTLEFT, MA_ACTIVATE, MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTRIGHT, MA_ACTIVATE, MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTTOP, MA_ACTIVATE, MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTTOPLEFT, MA_ACTIVATE, MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTTOPRIGHT, MA_ACTIVATE, MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTBOTTOM, MA_ACTIVATE, MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTBOTTOMLEFT, MA_ACTIVATE, MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTBOTTOMRIGHT, MA_ACTIVATE, MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTBORDER, MA_ACTIVATE, MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTOBJECT, MA_ACTIVATE, MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTCLOSE, MA_ACTIVATE, MA_ACTIVATE); + TEST_MOUSEACTIVATE(HTHELP, MA_ACTIVATE, MA_ACTIVATE);
ShowWindow(popup, SW_HIDE);