check desktop id (#12930)

This commit is contained in:
Seraphima Zykova 2021-08-27 16:59:04 +03:00 committed by GitHub
parent 4177708e49
commit 2b95eba51b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -356,7 +356,8 @@ void FancyZones::WindowCreated(HWND window) noexcept
return;
}
if (!m_virtualDesktop.IsWindowOnCurrentDesktop(window))
auto desktopId = m_virtualDesktop.GetDesktopId(window);
if (desktopId.has_value() && *desktopId != m_currentDesktopId)
{
// Switch between virtual desktops results with posting same windows messages that also indicate
// creation of new window. We need to check if window being processed is on currently active desktop.