When computing nonclient area take into consideration that a child
authorUlrich Czekalla <ulrich@codeweavers.com>
Sun, 27 Mar 2005 17:51:30 +0000 (17:51 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Sun, 27 Mar 2005 17:51:30 +0000 (17:51 +0000)
windows with the WS_POPUP style can have a menu bar.

windows/nonclient.c
windows/winpos.c

index 6072d13e5506e36fd0a09ab703dde5711784849c..429d3b5a063c2453c7409af4ca35701ca1544711 100644 (file)
@@ -79,7 +79,7 @@ static const BYTE lpGrayMask[] = { 0xAA, 0xA0,
      ((exStyle) & WS_EX_DLGMODALFRAME) || \
      !((style) & (WS_CHILD | WS_POPUP)))
 
-#define HAS_MENU(w)  (!((w)->dwStyle & WS_CHILD) && ((w)->wIDmenu != 0))
+#define HAS_MENU(w)  ((((w)->dwStyle & (WS_CHILD | WS_POPUP)) != WS_CHILD) && ((w)->wIDmenu != 0))
 
 
 /******************************************************************************
@@ -390,7 +390,7 @@ LONG NC_HandleNCCalcSize( HWND hwnd, RECT *winRect )
        winRect->right  -= tmpRect.right;
        winRect->bottom -= tmpRect.bottom;
 
-        if (!(style & WS_CHILD) && GetMenu(hwnd))
+        if (((style & (WS_CHILD | WS_POPUP)) != WS_CHILD) && GetMenu(hwnd))
         {
             TRACE("Calling GetMenuBarHeight with hwnd %p, width %ld, at (%ld, %ld).\n",
                   hwnd, winRect->right - winRect->left, -tmpRect.left, -tmpRect.top );
index 4dcf707349fab97886891188d84ee7c371fd181a..10e35cba1fe66e4410c24c4bdb85237bd53457e2 100644 (file)
@@ -747,7 +747,7 @@ void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
             style &= ~WS_BORDER; /* WS_CAPTION = WS_DLGFRAME | WS_BORDER */
 
         GetClientRect(GetAncestor(hwnd,GA_PARENT), &rc);
-        AdjustWindowRectEx(&rc, style, 0, exstyle);
+        AdjustWindowRectEx(&rc, style, ((style & WS_POPUP) && GetMenu(hwnd)), exstyle);
 
         /* avoid calculating this twice */
         style &= ~(WS_DLGFRAME | WS_BORDER | WS_THICKFRAME);