diff --git a/Console/MainFrame.cpp b/Console/MainFrame.cpp index 7af436c8..3b5db90e 100644 --- a/Console/MainFrame.cpp +++ b/Console/MainFrame.cpp @@ -783,14 +783,21 @@ LRESULT MainFrame::OnSettingChange(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lPar wstring strArea(reinterpret_cast(lParam)); - if (strArea == L"Windows") + // according to WM_SETTINGCHANGE doc: + // to change environment, lParam should be "Environment" + if (strArea == L"Environment") { - g_imageHandler->ReloadDesktopImages(); - m_activeView->Invalidate(); + ConsoleHandler::UpdateEnvironmentBlock(); } - else if (strArea == L"Environment") + else { - ConsoleHandler::UpdateEnvironmentBlock(); + // otherwise, we don't know what has changed + // technically, we can skip reloading for "Policy" and "intl", but + // hopefully they don't happen often, so reload everything + g_imageHandler->ReloadDesktopImages(); + + // can't use Invalidate because full repaint is in order + m_activeView->Repaint(true); } return 0;