mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
[FancyZones] Keep the same layouts on the new virtual desktops. (#23927)
This commit is contained in:
@@ -61,6 +61,28 @@ void MonitorWorkAreaMap::AddWorkArea(HMONITOR monitor, std::unique_ptr<WorkArea>
|
||||
m_workAreaMap.insert({ monitor, std::move(workArea) });
|
||||
}
|
||||
|
||||
FancyZonesDataTypes::WorkAreaId MonitorWorkAreaMap::GetParent(HMONITOR monitor) const
|
||||
{
|
||||
if (m_workAreaParents.contains(monitor))
|
||||
{
|
||||
return m_workAreaParents.at(monitor);
|
||||
}
|
||||
|
||||
return FancyZonesDataTypes::WorkAreaId{};
|
||||
}
|
||||
|
||||
void MonitorWorkAreaMap::SaveParentIds()
|
||||
{
|
||||
m_workAreaParents.clear();
|
||||
for (const auto& [monitor, workArea] : m_workAreaMap)
|
||||
{
|
||||
if (workArea)
|
||||
{
|
||||
m_workAreaParents.insert({ monitor, workArea->UniqueId() });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MonitorWorkAreaMap::Clear() noexcept
|
||||
{
|
||||
m_workAreaMap.clear();
|
||||
|
||||
Reference in New Issue
Block a user