[FancyZones] Move Trace::VirtualDesktopChange (#4320)

* Move Trace::VirtualDesktopChange to catch only the actual VD changes

* Update the check

* Add double check
This commit is contained in:
stefansjfw 2020-06-15 19:44:07 +02:00 committed by GitHub
parent 236c1208e6
commit f8cc129f04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -281,7 +281,6 @@ void FancyZonesModule::HandleWinHookEvent(WinHookEvent* data) noexcept
// switches virtual desktops.
if (data->hwnd == GetDesktopWindow())
{
Trace::VirtualDesktopChanged();
m_app.as<IFancyZonesCallback>()->VirtualDesktopChanged();
}
}

View File

@ -650,6 +650,10 @@ void FancyZones::OnDisplayChange(DisplayChangeType changeType) noexcept
if (VirtualDesktopUtils::GetCurrentVirtualDesktopId(&currentVirtualDesktopId))
{
m_currentDesktopId = currentVirtualDesktopId;
if (m_previousDesktopId != GUID_NULL && m_currentDesktopId != m_previousDesktopId)
{
Trace::VirtualDesktopChanged();
}
}
if (changeType == DisplayChangeType::Initialization)
{