[WIN32K] -Correct one parameter in NtUserPaintMenuBar and make it return the height...
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Sat, 1 Apr 2017 10:18:40 +0000 (10:18 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Sat, 1 Apr 2017 10:18:40 +0000 (10:18 +0000)
[UXTHEME] -Pass the correct parameter to PaintMenuBar. Draw the edge of WS_EX_CLIENTEDGE even if the window has a themed frame.

svn path=/trunk/; revision=74260

reactos/dll/win32/uxtheme/nonclient.c
reactos/win32ss/user/ntuser/menu.c

index 962c5cb..b2c107d 100644 (file)
@@ -474,11 +474,17 @@ DrawClassicFrame(PDRAW_CONTEXT context, RECT* prcCurrent)
 
         InflateRect(prcCurrent, -Width, -Height);
     }
+}
 
-    if (context->wi.dwExStyle & WS_EX_CLIENTEDGE)
-    {
-        DrawEdge(context->hDC, prcCurrent, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
-    }
+static void ThemeDrawMenuBar(PDRAW_CONTEXT pcontext, RECT* prcCurrent)
+{
+    /* Let the window manager paint the menu */
+    prcCurrent->top += PaintMenuBar(pcontext->hWnd, 
+                                    pcontext->hDC, 
+                                    pcontext->wi.cxWindowBorders, 
+                                    pcontext->wi.cxWindowBorders,
+                                    prcCurrent->top, 
+                                    pcontext->Active);
 }
 
 static void 
@@ -505,7 +511,10 @@ ThemePaintWindow(PDRAW_CONTEXT pcontext, RECT* prcCurrent, BOOL bDoDoubleBufferi
         return;
 
     if(HAS_MENU(pcontext->hWnd, pcontext->wi.dwStyle))
-        PaintMenuBar(pcontext->hWnd, pcontext->hDC, prcCurrent->left, prcCurrent->right, prcCurrent->top, pcontext->Active);
+        ThemeDrawMenuBar(pcontext, prcCurrent);
+
+    if (pcontext->wi.dwExStyle & WS_EX_CLIENTEDGE)
+        DrawEdge(pcontext->hDC, prcCurrent, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
 
     if(pcontext->wi.dwStyle & WS_HSCROLL)
         ThemeDrawScrollBar(pcontext, SB_HORZ , NULL);
index 2d3ee0e..6db88eb 100644 (file)
@@ -6050,13 +6050,14 @@ APIENTRY
 NtUserPaintMenuBar(
     HWND hWnd,
     HDC hDC,
-    ULONG left,
-    ULONG right,
+    ULONG leftBorder,
+    ULONG rightBorder,
     ULONG top,
     BOOL bActive)
 {
    PWND Window;
    RECT Rect;
+   DWORD ret;
 
    UserEnterExclusive();
 
@@ -6067,17 +6068,16 @@ NtUserPaintMenuBar(
       return 0;
    }
 
-   Rect.left = left;
-   Rect.right = right;
+   Rect.left = leftBorder;
+   Rect.right = Window->rcWindow.right - Window->rcWindow.left - rightBorder;
    Rect.top = top;
    Rect.bottom = 0;
 
-   MENU_DrawMenuBar(hDC, &Rect, Window, FALSE);
+   ret = MENU_DrawMenuBar(hDC, &Rect, Window, FALSE);
 
    UserLeave();
 
-   /* I am not sure about what this function returns */
-   return 0;
+   return ret;
 }
 
 /*