[FancyZones] Prevent snapping to invalid zone (#28206)

This commit is contained in:
Seraphima Zykova
2023-08-29 19:59:02 +03:00
committed by GitHub
parent ebc181bced
commit 2305c8e754
2 changed files with 30 additions and 0 deletions

View File

@@ -124,6 +124,14 @@ bool WorkArea::Snap(HWND window, const ZoneIndexSet& zones, bool updatePosition)
return false;
}
for (ZoneIndex zone : zones)
{
if (static_cast<size_t>(zone) >= m_layout->Zones().size())
{
return false;
}
}
m_layoutWindows.Assign(window, zones);
AppZoneHistory::instance().SetAppLastZones(window, m_uniqueId, m_layout->Id(), zones);