From 9650f21b2db51ba85e578ebfefb84e4444c75145 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Fri, 16 Jan 2015 11:10:39 +0000 Subject: [PATCH] user32: Actually use the menu's background brush. --- 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 f0eb66bda79..847540b63af 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 */