[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:
vldmr11080
2020-11-17 12:39:31 +01:00
committed by GitHub
parent 5477dbe396
commit 9ccd97798f
3 changed files with 25 additions and 28 deletions

View File

@@ -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();
}