mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
[FancyZones] Enable to manually zone child windows (#6182)
* Enable to manually zone child windows * Refactor IsInterestingWindow in 2 separate functions * Remove enum
This commit is contained in:
@@ -346,11 +346,12 @@ FancyZones::VirtualDesktopInitialize() noexcept
|
||||
|
||||
bool FancyZones::ShouldProcessNewWindow(HWND window) noexcept
|
||||
{
|
||||
using namespace FancyZonesUtils;
|
||||
// Avoid processing splash screens, already stamped (zoned) windows, or those windows
|
||||
// that belong to excluded applications list.
|
||||
if (IsSplashScreen(window) ||
|
||||
(reinterpret_cast<size_t>(::GetProp(window, ZonedWindowProperties::PropertyMultipleZoneID)) != 0) ||
|
||||
!FancyZonesUtils::IsInterestingWindow(window, m_settings->GetSettings()->excludedAppsArray))
|
||||
!IsCandidateForLastKnownZone(window, m_settings->GetSettings()->excludedAppsArray))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -1031,7 +1032,7 @@ void FancyZones::UpdateWindowsPositions() noexcept
|
||||
void FancyZones::CycleActiveZoneSet(DWORD vkCode) noexcept
|
||||
{
|
||||
auto window = GetForegroundWindow();
|
||||
if (FancyZonesUtils::IsInterestingWindow(window, m_settings->GetSettings()->excludedAppsArray))
|
||||
if (FancyZonesUtils::IsCandidateForZoning(window, m_settings->GetSettings()->excludedAppsArray))
|
||||
{
|
||||
const HMONITOR monitor = MonitorFromWindow(window, MONITOR_DEFAULTTONULL);
|
||||
if (monitor)
|
||||
@@ -1248,7 +1249,7 @@ bool FancyZones::OnSnapHotkeyBasedOnPosition(HWND window, DWORD vkCode) noexcept
|
||||
bool FancyZones::OnSnapHotkey(DWORD vkCode) noexcept
|
||||
{
|
||||
auto window = GetForegroundWindow();
|
||||
if (FancyZonesUtils::IsInterestingWindow(window, m_settings->GetSettings()->excludedAppsArray))
|
||||
if (FancyZonesUtils::IsCandidateForZoning(window, m_settings->GetSettings()->excludedAppsArray))
|
||||
{
|
||||
if (m_settings->GetSettings()->moveWindowsBasedOnPosition)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user