From 118f333ac233c69399a01424a6218d130983d644 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Tue, 19 Feb 2019 12:17:38 -0600 Subject: [PATCH] user32: Use the C[XY]MINIMIZED rather than C[XY]ICON size for minimized windows. Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/user32/tests/win.c | 6 ------ dlls/user32/winpos.c | 12 ++++++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 308e243c3dd..8111ec0e5ee 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -6529,7 +6529,6 @@ static void test_ShowWindow(void) ok(style & WS_MINIMIZE, "window should be minimized\n"); ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); GetWindowRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); @@ -6542,7 +6541,6 @@ static void test_ShowWindow(void) SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER); ok(ret, "not expected ret: %lu\n", ret); GetWindowRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); @@ -6553,7 +6551,6 @@ static void test_ShowWindow(void) SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER); ok(ret, "not expected ret: %lu\n", ret); GetWindowRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); @@ -6650,7 +6647,6 @@ static void test_ShowWindow(void) ok(style & WS_MINIMIZE, "window should be minimized\n"); ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); GetWindowRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); @@ -6665,7 +6661,6 @@ static void test_ShowWindow(void) ok(style & WS_MINIMIZE, "window should be minimized\n"); ok(!(style & WS_MAXIMIZE), "window should not be maximized\n"); GetWindowRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); @@ -6725,7 +6720,6 @@ static void test_ShowWindow(void) style = GetWindowLongA(hwnd, GWL_STYLE); ok(style & WS_MINIMIZE, "window should be minimized\n"); GetWindowRect(hwnd, &rc); - todo_wine ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n", wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc)); GetClientRect(hwnd, &rc); diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index 38444b243fb..bca50ca12a1 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -975,8 +975,8 @@ UINT WINPOS_MinMaximize( HWND hwnd, UINT cmd, LPRECT rect ) wpl.ptMinPosition = WINPOS_FindIconPos( hwnd, wpl.ptMinPosition ); SetRect( rect, wpl.ptMinPosition.x, wpl.ptMinPosition.y, - wpl.ptMinPosition.x + GetSystemMetrics(SM_CXICON), - wpl.ptMinPosition.y + GetSystemMetrics(SM_CYICON) ); + wpl.ptMinPosition.x + GetSystemMetrics(SM_CXMINIMIZED), + wpl.ptMinPosition.y + GetSystemMetrics(SM_CYMINIMIZED) ); return SWP_NOSIZE | SWP_NOMOVE; } if (!SendMessageW( hwnd, WM_QUERYOPEN, 0, 0 )) return SWP_NOSIZE | SWP_NOMOVE; @@ -1006,8 +1006,8 @@ UINT WINPOS_MinMaximize( HWND hwnd, UINT cmd, LPRECT rect ) if (!(old_style & WS_MINIMIZE)) swpFlags |= SWP_STATECHANGED; SetRect( rect, wpl.ptMinPosition.x, wpl.ptMinPosition.y, - wpl.ptMinPosition.x + GetSystemMetrics(SM_CXICON), - wpl.ptMinPosition.y + GetSystemMetrics(SM_CYICON) ); + wpl.ptMinPosition.x + GetSystemMetrics(SM_CXMINIMIZED), + wpl.ptMinPosition.y + GetSystemMetrics(SM_CYMINIMIZED) ); swpFlags |= SWP_NOCOPYBITS; break; @@ -1705,8 +1705,8 @@ static BOOL SWP_DoWinPosChanging( WINDOWPOS *pWinpos, RECT *old_window_rect, REC { if (wndPtr->dwStyle & WS_MINIMIZE) { - new_window_rect->right = new_window_rect->left + GetSystemMetrics(SM_CXICON); - new_window_rect->bottom = new_window_rect->top + GetSystemMetrics(SM_CYICON); + new_window_rect->right = new_window_rect->left + GetSystemMetrics(SM_CXMINIMIZED); + new_window_rect->bottom = new_window_rect->top + GetSystemMetrics(SM_CYMINIMIZED); } else {