mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
[FancyZones] Allow snapping apps launched by Workspaces (#35067)
This commit is contained in:
@@ -398,7 +398,7 @@ void FancyZones::WindowCreated(HWND window) noexcept
|
||||
return;
|
||||
}
|
||||
|
||||
if (!FancyZonesWindowProcessing::IsProcessable(window))
|
||||
if (!FancyZonesWindowProcessing::IsProcessableAutomatically(window))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1084,7 +1084,7 @@ bool FancyZones::ShouldProcessSnapHotkey(DWORD vkCode) noexcept
|
||||
}
|
||||
|
||||
auto window = GetForegroundWindow();
|
||||
if (!FancyZonesWindowProcessing::IsProcessable(window))
|
||||
if (!FancyZonesWindowProcessing::IsProcessableManually(window))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -65,16 +65,28 @@ FancyZonesWindowProcessing::ProcessabilityType FancyZonesWindowProcessing::Defin
|
||||
return ProcessabilityType::NotCurrentVirtualDesktop;
|
||||
}
|
||||
|
||||
// Ignore windows launched by Workspaces
|
||||
if (FancyZonesWindowProperties::IsLaunchedByWorkspaces(window))
|
||||
{
|
||||
return ProcessabilityType::LaunchedByWorkspaces;
|
||||
}
|
||||
|
||||
return ProcessabilityType::Processable;
|
||||
}
|
||||
|
||||
bool FancyZonesWindowProcessing::IsProcessable(HWND window) noexcept
|
||||
bool FancyZonesWindowProcessing::IsProcessableAutomatically(HWND window) noexcept
|
||||
{
|
||||
return DefineWindowType(window) == ProcessabilityType::Processable;
|
||||
auto type = DefineWindowType(window);
|
||||
if (type != ProcessabilityType::Processable)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Ignore windows launched by Workspaces
|
||||
if (FancyZonesWindowProperties::IsLaunchedByWorkspaces(window))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FancyZonesWindowProcessing::IsProcessableManually(HWND window) noexcept
|
||||
{
|
||||
auto type = DefineWindowType(window);
|
||||
return type == ProcessabilityType::Processable;
|
||||
}
|
||||
|
||||
@@ -13,10 +13,10 @@ namespace FancyZonesWindowProcessing
|
||||
NonProcessablePopupWindow,
|
||||
ChildWindow,
|
||||
Excluded,
|
||||
NotCurrentVirtualDesktop,
|
||||
LaunchedByWorkspaces
|
||||
NotCurrentVirtualDesktop
|
||||
};
|
||||
|
||||
ProcessabilityType DefineWindowType(HWND window) noexcept;
|
||||
bool IsProcessable(HWND window) noexcept;
|
||||
bool IsProcessableAutomatically(HWND window) noexcept;
|
||||
bool IsProcessableManually(HWND window) noexcept;
|
||||
}
|
||||
@@ -29,7 +29,7 @@ WindowMouseSnap::~WindowMouseSnap()
|
||||
|
||||
std::unique_ptr<WindowMouseSnap> WindowMouseSnap::Create(HWND window, const std::unordered_map<HMONITOR, std::unique_ptr<WorkArea>>& activeWorkAreas)
|
||||
{
|
||||
if (FancyZonesWindowUtils::IsCursorTypeIndicatingSizeEvent() || !FancyZonesWindowProcessing::IsProcessable(window))
|
||||
if (FancyZonesWindowUtils::IsCursorTypeIndicatingSizeEvent() || !FancyZonesWindowProcessing::IsProcessableManually(window))
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user