Alexandre Julliard : user32: Make sure AdjustWindowRect and WM_NCCALCSIZE yield the same result for WS_EX_DLGMODALFRAME windows .

Alexandre Julliard julliard at winehq.org
Tue Oct 12 11:26:58 CDT 2010


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Oct 12 11:28:51 2010 +0200

user32: Make sure AdjustWindowRect and WM_NCCALCSIZE yield the same result for WS_EX_DLGMODALFRAME windows.

---

 dlls/user32/nonclient.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c
index 64c1186..d2bcdcb 100644
--- a/dlls/user32/nonclient.c
+++ b/dlls/user32/nonclient.c
@@ -86,7 +86,6 @@ static void
 NC_AdjustRectOuter (LPRECT rect, DWORD style, BOOL menu, DWORD exStyle)
 {
     int adjust;
-    if(style & WS_ICONIC) return;
 
     if ((exStyle & (WS_EX_STATICEDGE|WS_EX_DLGMODALFRAME)) ==
         WS_EX_STATICEDGE)
@@ -99,7 +98,7 @@ NC_AdjustRectOuter (LPRECT rect, DWORD style, BOOL menu, DWORD exStyle)
         if ((exStyle & WS_EX_DLGMODALFRAME) ||
             (style & (WS_THICKFRAME|WS_DLGFRAME))) adjust = 2; /* outer */
     }
-    if (style & WS_THICKFRAME)
+    if ((style & WS_THICKFRAME) && !(exStyle & WS_EX_DLGMODALFRAME))
         adjust +=  ( GetSystemMetrics (SM_CXFRAME)
                    - GetSystemMetrics (SM_CXDLGFRAME)); /* The resize border */
     if ((style & (WS_BORDER|WS_DLGFRAME)) ||
@@ -140,8 +139,6 @@ NC_AdjustRectOuter (LPRECT rect, DWORD style, BOOL menu, DWORD exStyle)
 static void
 NC_AdjustRectInner (LPRECT rect, DWORD style, DWORD exStyle)
 {
-    if(style & WS_ICONIC) return;
-
     if (exStyle & WS_EX_CLIENTEDGE)
         InflateRect(rect, GetSystemMetrics(SM_CXEDGE), GetSystemMetrics(SM_CYEDGE));
 
@@ -390,11 +387,8 @@ BOOL WINAPI AdjustWindowRect( LPRECT rect, DWORD style, BOOL menu )
  */
 BOOL WINAPI AdjustWindowRectEx( LPRECT rect, DWORD style, BOOL menu, DWORD exStyle )
 {
-    /* Correct the window style */
-    style &= (WS_DLGFRAME | WS_BORDER | WS_THICKFRAME | WS_CHILD);
-    exStyle &= (WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE |
-                WS_EX_STATICEDGE | WS_EX_TOOLWINDOW);
-    if (exStyle & WS_EX_DLGMODALFRAME) style &= ~WS_THICKFRAME;
+    if (style & WS_ICONIC) return TRUE;
+    style &= ~(WS_HSCROLL | WS_VSCROLL);
 
     TRACE("(%s) %08x %d %08x\n", wine_dbgstr_rect(rect), style, menu, exStyle );
 
@@ -424,7 +418,7 @@ LRESULT NC_HandleNCCalcSize( HWND hwnd, WPARAM wparam, RECT *winRect )
     if (cls_style & CS_VREDRAW) result |= WVR_VREDRAW;
     if (cls_style & CS_HREDRAW) result |= WVR_HREDRAW;
 
-    if (!IsIconic(hwnd))
+    if (!(style & WS_ICONIC))
     {
         NC_AdjustRectOuter( &tmpRect, style, FALSE, exStyle );
 




More information about the wine-cvs mailing list