Skip to content

Commit

Permalink
Improve handling of WM_SETTINGCHANGE, including forced full repaint
Browse files Browse the repository at this point in the history
The change is inspired by Patch 2781047 "BugFix for 1632808/2002160 (b144)"
by GrayNM:
Solution, used to detect wallpaper changes, doesn`t work for utilities
like "Wallpaper Master" etc.

Moreover background repainting doesn`t occur even if change was detected

Notes by Kirill:
- 1632808 was closed as fixed long time ago, but was broken by b817683;
- FR 2002160 (aka 2924201) is indeed would be implemented by the patch;

However, the doc on WM_SETTINGCHANGE makes no guarantees about wParam, thus
this is more conservative, but probably more costly fix.
  • Loading branch information
Kirill committed Feb 12, 2010
1 parent ffdd885 commit bf4bdc8
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Console/MainFrame.cpp
Expand Up @@ -783,14 +783,21 @@ LRESULT MainFrame::OnSettingChange(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lPar

wstring strArea(reinterpret_cast<wchar_t*>(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;
Expand Down

0 comments on commit bf4bdc8

Please sign in to comment.