mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 04:07:40 +02:00
Skip cloning device information from parent virtual desktop if it is deleted. (#1415)
This commit is contained in:
@@ -209,7 +209,18 @@ namespace JSONHelpers
|
|||||||
|
|
||||||
void FancyZonesData::CloneDeviceInfo(const std::wstring& source, const std::wstring& destination)
|
void FancyZonesData::CloneDeviceInfo(const std::wstring& source, const std::wstring& destination)
|
||||||
{
|
{
|
||||||
|
if (source == destination)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
std::scoped_lock lock{ dataLock };
|
std::scoped_lock lock{ dataLock };
|
||||||
|
|
||||||
|
// The source virtual desktop is deleted, simply ignore it.
|
||||||
|
if (!deviceInfoMap.contains(source))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Clone information from source device if destination device is uninitialized (Blank).
|
// Clone information from source device if destination device is uninitialized (Blank).
|
||||||
auto& destInfo = deviceInfoMap[destination];
|
auto& destInfo = deviceInfoMap[destination];
|
||||||
if (destInfo.activeZoneSet.type == ZoneSetLayoutType::Blank)
|
if (destInfo.activeZoneSet.type == ZoneSetLayoutType::Blank)
|
||||||
|
|||||||
Reference in New Issue
Block a user