check desktop id (#12930)

This commit is contained in:
Seraphima Zykova 2021-08-27 16:59:04 +03:00 committed by Jaime Bernardo
parent da46b90457
commit 2696b935c5

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.