mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-23 23:20:05 +01:00
[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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user