Menu: nonclient calc

Ulrich Czekalla ulrich.czekalla at utoronto.ca
Fri Mar 25 14:07:17 CST 2005


ChangeLog:
    Ulrich Czekalla <ulrich at codeweavers.com>
    When computing nonclient area take into consideration that a child
    windows with the WS_POPUP style can have a menu bar  
-------------- next part --------------
Index: windows/nonclient.c
===================================================================
RCS file: /home/wine/wine/windows/nonclient.c,v
retrieving revision 1.137
diff -u -p -r1.137 nonclient.c
--- windows/nonclient.c	25 Mar 2005 16:47:04 -0000	1.137
+++ windows/nonclient.c	25 Mar 2005 20:08:24 -0000
@@ -79,7 +79,7 @@ static const BYTE lpGrayMask[] = { 0xAA,
      ((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, REC
 	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: windows/winpos.c
===================================================================
RCS file: /home/wine/wine/windows/winpos.c,v
retrieving revision 1.169
diff -u -p -r1.169 winpos.c
--- windows/winpos.c	24 Mar 2005 20:41:27 -0000	1.169
+++ windows/winpos.c	25 Mar 2005 20:08:24 -0000
@@ -747,7 +747,7 @@ void WINPOS_GetMinMaxInfo( HWND hwnd, PO
             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);


More information about the wine-patches mailing list