Huw Davies : user32: Restore the dc's colours after sending WM_DRAWITEM.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Nov 2 09:47:15 CST 2015


Module: wine
Branch: master
Commit: e79684874d6be3e28504480ca434f593919ac421
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e79684874d6be3e28504480ca434f593919ac421

Author: Huw Davies <huw at codeweavers.com>
Date:   Mon Nov  2 10:10:54 2015 +0000

user32: Restore the dc's colours after sending WM_DRAWITEM.

Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/menu.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c
index 847540b..2db18b4 100644
--- a/dlls/user32/menu.c
+++ b/dlls/user32/menu.c
@@ -1458,6 +1458,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
         ** the menu owner has finished drawing.
         */
         DRAWITEMSTRUCT dis;
+        COLORREF old_bk, old_text;
 
         dis.CtlType   = ODT_MENU;
 	dis.CtlID     = 0;
@@ -1475,8 +1476,12 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
 	      "hwndItem=%p, hdc=%p, rcItem=%s\n", hwndOwner,
 	      dis.itemID, dis.itemState, dis.itemAction, dis.hwndItem,
 	      dis.hDC, wine_dbgstr_rect( &dis.rcItem));
+        old_bk = GetBkColor( hdc );
+        old_text = GetTextColor( hdc );
         SendMessageW( hwndOwner, WM_DRAWITEM, 0, (LPARAM)&dis );
         /* Draw the popup-menu arrow */
+        SetBkColor( hdc, old_bk );
+        SetTextColor( hdc, old_text );
         if (lpitem->fType & MF_POPUP)
             draw_popup_arrow( hdc, rect, arrow_bitmap_width,
                     arrow_bitmap_height);




More information about the wine-cvs mailing list