[FancyZones]Fix snap by hotkey for single-zone layouts (#22373)

* unsnap window from previous work area when snapping by hotkey
This commit is contained in:
Seraphima Zykova
2022-12-02 13:29:11 +03:00
committed by GitHub
parent a7bd0cfde8
commit eca77ad8b3
5 changed files with 30 additions and 5 deletions

View File

@@ -462,6 +462,22 @@ void WorkArea::SaveWindowProcessToZoneIndex(HWND window) noexcept
}
}
bool WorkArea::UnsnapWindow(HWND window) noexcept
{
if (!m_layoutWindows)
{
return false;
}
if (!m_layoutWindows->GetZoneIndexSetFromWindow(window).empty())
{
m_layoutWindows->Dismiss(window);
return true;
}
return false;
}
ZoneIndexSet WorkArea::GetWindowZoneIndexes(HWND window) const noexcept
{
if (m_layout)