mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 19:57:57 +01:00
[FancyZones] Update primary desktop data on virtual desktop switch (#7994)
* Update primary desktop data after virtual desktop switch * Don't remove zeroed-GUID inside RemoveDeletedDesktops method * Minor refactoring in VirtualDesktopUtils * Use std::vector::empty check instead of comparing size with 0
This commit is contained in:
@@ -262,16 +262,17 @@ void FancyZonesData::RemoveDeletedDesktops(const std::vector<std::wstring>& acti
|
||||
for (auto it = std::begin(deviceInfoMap); it != std::end(deviceInfoMap);)
|
||||
{
|
||||
std::wstring desktopId = ExtractVirtualDesktopId(it->first);
|
||||
auto foundId = active.find(desktopId);
|
||||
if (foundId == std::end(active))
|
||||
if (desktopId != NonLocalizable::DefaultGuid)
|
||||
{
|
||||
RemoveDesktopAppZoneHistory(desktopId);
|
||||
it = deviceInfoMap.erase(it);
|
||||
}
|
||||
else
|
||||
{
|
||||
++it;
|
||||
auto foundId = active.find(desktopId);
|
||||
if (foundId == std::end(active))
|
||||
{
|
||||
RemoveDesktopAppZoneHistory(desktopId);
|
||||
it = deviceInfoMap.erase(it);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
++it;
|
||||
}
|
||||
SaveFancyZonesData();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user