[PATCH 2/2] user32: Actually use the menu's background brush.
Huw Davies
huw at codeweavers.com
Fri Jan 16 05:10:39 CST 2015
---
dlls/user32/menu.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c
index f0eb66b..847540b 100644
--- a/dlls/user32/menu.c
+++ b/dlls/user32/menu.c
@@ -1737,15 +1737,17 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
*/
static void MENU_DrawPopupMenu( HWND hwnd, HDC hdc, HMENU hmenu )
{
- HBRUSH hPrevBrush = 0;
+ HBRUSH hPrevBrush = 0, brush = GetSysColorBrush( COLOR_MENU );
RECT rect;
+ POPUPMENU *menu = MENU_GetMenu( hmenu );
TRACE("wnd=%p dc=%p menu=%p\n", hwnd, hdc, hmenu);
GetClientRect( hwnd, &rect );
- if((hPrevBrush = SelectObject( hdc, GetSysColorBrush(COLOR_MENU) ))
- && (SelectObject( hdc, get_menu_font(FALSE))))
+ if (menu && menu->hbrBack) brush = menu->hbrBack;
+ if ((hPrevBrush = SelectObject( hdc, brush ))
+ && SelectObject( hdc, get_menu_font(FALSE) ))
{
HPEN hPrevPen;
@@ -1754,7 +1756,6 @@ static void MENU_DrawPopupMenu( HWND hwnd, HDC hdc, HMENU hmenu )
hPrevPen = SelectObject( hdc, GetStockObject( NULL_PEN ) );
if( hPrevPen )
{
- POPUPMENU *menu;
BOOL flat_menu = FALSE;
SystemParametersInfoW (SPI_GETFLATMENU, 0, &flat_menu, 0);
@@ -1763,7 +1764,7 @@ static void MENU_DrawPopupMenu( HWND hwnd, HDC hdc, HMENU hmenu )
else
DrawEdge (hdc, &rect, EDGE_RAISED, BF_RECT);
- if( (menu = MENU_GetMenu( hmenu )))
+ if (menu)
{
TRACE("hmenu %p Style %08x\n", hmenu, menu->dwStyle);
/* draw menu items */
--
1.8.0
More information about the wine-patches
mailing list