mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-10 05:06:36 +02:00
[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:
@@ -638,6 +638,9 @@ LRESULT FancyZones::WndProc(HWND window, UINT message, WPARAM wparam, LPARAM lpa
|
|||||||
{
|
{
|
||||||
if (wparam == SPI_SETWORKAREA)
|
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);
|
OnDisplayChange(DisplayChangeType::WorkArea);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -645,6 +648,8 @@ LRESULT FancyZones::WndProc(HWND window, UINT message, WPARAM wparam, LPARAM lpa
|
|||||||
|
|
||||||
case WM_DISPLAYCHANGE:
|
case WM_DISPLAYCHANGE:
|
||||||
{
|
{
|
||||||
|
// Display resolution changed. Invalidate cached work-areas so they can be recreated with latest information.
|
||||||
|
m_workAreaHandler.Clear();
|
||||||
OnDisplayChange(DisplayChangeType::DisplayChange);
|
OnDisplayChange(DisplayChangeType::DisplayChange);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user