https://git.reactos.org/?p=reactos.git;a=commitdiff;h=924a8fea10edb333d311f94cfbc58488dd7da571

commit 924a8fea10edb333d311f94cfbc58488dd7da571
Author:     Katayama Hirofumi MZ <[email protected]>
AuthorDate: Mon Oct 10 08:45:04 2022 +0900
Commit:     Katayama Hirofumi MZ <[email protected]>
CommitDate: Mon Oct 10 08:45:04 2022 +0900

    [SHELL32] De-select m_marlett on CMenuToolbarBase::OnCustomDraw
    
    CORE-13194
---
 dll/win32/shell32/shellmenu/CMenuToolbars.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dll/win32/shell32/shellmenu/CMenuToolbars.cpp 
b/dll/win32/shell32/shellmenu/CMenuToolbars.cpp
index 1eee01f0344..d99f5fc2e5f 100644
--- a/dll/win32/shell32/shellmenu/CMenuToolbars.cpp
+++ b/dll/win32/shell32/shellmenu/CMenuToolbars.cpp
@@ -246,7 +246,7 @@ HRESULT CMenuToolbarBase::OnCustomDraw(LPNMTBCUSTOMDRAW 
cdraw, LRESULT * theResu
             WCHAR text [] = L"8";
 
             // Configure the font to draw with Marlett, keeping the current 
background color as-is
-            SelectObject(cdraw->nmcd.hdc, m_marlett);
+            HGDIOBJ hFontOld = SelectObject(cdraw->nmcd.hdc, m_marlett);
             SetBkMode(cdraw->nmcd.hdc, TRANSPARENT);
 
             // Tweak the alignment by 1 pixel so the menu draws like the 
Windows start menu.
@@ -255,6 +255,8 @@ HRESULT CMenuToolbarBase::OnCustomDraw(LPNMTBCUSTOMDRAW 
cdraw, LRESULT * theResu
 
             // The arrow is drawn at the right of the item's rect, aligned 
vertically.
             DrawTextEx(cdraw->nmcd.hdc, text, 1, &rc, DT_NOCLIP | DT_VCENTER | 
DT_RIGHT | DT_SINGLELINE, NULL);
+
+            SelectObject(cdraw->nmcd.hdc, hFontOld);
         }
         *theResult = TRUE;
         return S_OK;

Reply via email to