Skip to content

Commit

Permalink
prevent changing the dark mode setting of a window multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
stefankueng committed Oct 14, 2023
1 parent 4fef5b8 commit 15601b7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Theme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ bool CTheme::SetThemeForDialog(HWND hWnd, bool bDark)

BOOL CTheme::AdjustThemeForChildrenProc(HWND hwnd, LPARAM lParam)
{
if (reinterpret_cast<LPARAM>(GetProp(hwnd, L"BowPadDarkMode")) == lParam)
return TRUE;
SetProp(hwnd, L"BowPadDarkMode", reinterpret_cast<HANDLE>(lParam));
DarkModeHelper::Instance().AllowDarkModeForWindow(hwnd, static_cast<BOOL>(lParam));
wchar_t szWndClassName[MAX_PATH] = {0};
GetClassName(hwnd, szWndClassName, _countof(szWndClassName));
Expand Down

0 comments on commit 15601b7

Please sign in to comment.