[FancyZones] Invalidate cached work areas when display resolution or taskbar position changes (#4800)

* Invalidate cached work areas when display resolution or taskbar position changes

* Update comments in code
This commit is contained in:
vldmr11080 2020-07-06 17:34:28 +02:00 committed by GitHub
parent 11df74c292
commit 3d623506a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -638,6 +638,9 @@ LRESULT FancyZones::WndProc(HWND window, UINT message, WPARAM wparam, LPARAM lpa
{
if (wparam == SPI_SETWORKAREA)
{
// Changes in taskbar position resulted in different size of work area.
// Invalidate cached work-areas so they can be recreated with latest information.
m_workAreaHandler.Clear();
OnDisplayChange(DisplayChangeType::WorkArea);
}
}
@ -645,6 +648,8 @@ LRESULT FancyZones::WndProc(HWND window, UINT message, WPARAM wparam, LPARAM lpa
case WM_DISPLAYCHANGE:
{
// Display resolution changed. Invalidate cached work-areas so they can be recreated with latest information.
m_workAreaHandler.Clear();
OnDisplayChange(DisplayChangeType::DisplayChange);
}
break;