Dylan Smith : user32: Prevent resize of minimized windows from SetWindowPos .

Alexandre Julliard julliard at winehq.org
Thu Jul 22 12:09:29 CDT 2010


Module: wine
Branch: master
Commit: 9f32d6d6a94d56d64bac6903f8c218d8e0c20b07
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9f32d6d6a94d56d64bac6903f8c218d8e0c20b07

Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date:   Tue Jul 20 17:53:23 2010 -0400

user32: Prevent resize of minimized windows from SetWindowPos.

---

 dlls/user32/tests/win.c |    2 +-
 dlls/user32/winpos.c    |   12 ++++++++++--
 2 files changed, 11 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..e5e4e0c 100644
--- a/dlls/user32/winpos.c
+++ b/dlls/user32/winpos.c
@@ -1519,8 +1519,16 @@ 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))
     {




More information about the wine-cvs mailing list