[FancyZones] Only process windows located on currently active work area when moving them (#2691)

* Only process windows located on currently active work area when moving them.

* Move all editor exit handling into dedicated method.
This commit is contained in:
vldmr11080
2020-05-06 17:16:16 +02:00
committed by GitHub
parent 8b988409e2
commit 56c0a78c64
4 changed files with 36 additions and 14 deletions

View File

@@ -8,6 +8,7 @@
#include "lib/Settings.h"
#include "lib/ZoneWindow.h"
#include "lib/util.h"
#include "VirtualDesktopUtils.h"
extern "C" IMAGE_DOS_HEADER __ImageBase;
@@ -298,6 +299,15 @@ void WindowMoveHandlerPrivate::MoveWindowIntoZoneByIndexSet(HWND window, HMONITO
if (zoneWindow != zoneWindowMap.end())
{
const auto& zoneWindowPtr = zoneWindow->second;
// Only process windows located on currently active work area.
GUID windowDesktopId{};
GUID zoneWindowDesktopId{};
if (VirtualDesktopUtils::GetWindowDesktopId(window, &windowDesktopId) &&
VirtualDesktopUtils::GetZoneWindowDesktopId(zoneWindowPtr.get(), &zoneWindowDesktopId) &&
(windowDesktopId != zoneWindowDesktopId))
{
return;
}
zoneWindowPtr->MoveWindowIntoZoneByIndexSet(window, indexSet);
}
}