[2/2] user32: Prevent resize of minimized windows from SetWindowPos (Bug 1719).
Dylan Smith
dylan.ah.smith at gmail.com
Tue Jul 20 16:53:23 CDT 2010
---
dlls/user32/tests/win.c | 2 +-
dlls/user32/winpos.c | 9 +++++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index 522a0f5..632e382 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -4923,7 +4923,7 @@ 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(&rc, &rcMinimized), "rects should match\n");
+ ok(EqualRect(&rc, &rcMinimized), "rects should match\n");
ShowWindow(hwnd, SW_RESTORE);
ok(ret, "not expected ret: %lu\n", ret);
diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
index dd529dc..a65b018 100644
--- a/dlls/user32/winpos.c
+++ b/dlls/user32/winpos.c
@@ -1519,8 +1519,13 @@ static BOOL SWP_DoWinPosChanging( WINDOWPOS* pWinpos, RECT* pNewWindowRect, RECT
if (!(pWinpos->flags & SWP_NOSIZE))
{
- pNewWindowRect->right = pNewWindowRect->left + pWinpos->cx;
- pNewWindowRect->bottom = pNewWindowRect->top + pWinpos->cy;
+ if (wndPtr->dwStyle & WS_MINIMIZE) {
+ pNewWindowRect->right = pNewWindowRect->left + GetSystemMetrics(SM_CXICON);
+ pNewWindowRect->bottom = pNewWindowRect->top + GetSystemMetrics(SM_CYICON);
+ } else {
+ pNewWindowRect->right = pNewWindowRect->left + pWinpos->cx;
+ pNewWindowRect->bottom = pNewWindowRect->top + pWinpos->cy;
+ }
}
if (!(pWinpos->flags & SWP_NOMOVE))
{
--
1.7.0.4
More information about the wine-patches
mailing list