mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 03:37:59 +01:00
FZ: ignore projects launched windows
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "FancyZonesWindowProcessing.h"
|
#include "FancyZonesWindowProcessing.h"
|
||||||
|
|
||||||
|
#include <FancyZonesLib/FancyZonesWindowProperties.h>
|
||||||
#include <FancyZonesLib/Settings.h>
|
#include <FancyZonesLib/Settings.h>
|
||||||
#include <FancyZonesLib/VirtualDesktop.h>
|
#include <FancyZonesLib/VirtualDesktop.h>
|
||||||
#include <FancyZonesLib/WindowUtils.h>
|
#include <FancyZonesLib/WindowUtils.h>
|
||||||
@@ -64,6 +65,12 @@ FancyZonesWindowProcessing::ProcessabilityType FancyZonesWindowProcessing::Defin
|
|||||||
return ProcessabilityType::NotCurrentVirtualDesktop;
|
return ProcessabilityType::NotCurrentVirtualDesktop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ignore windows launched by Projects
|
||||||
|
if (FancyZonesWindowProperties::RetrieveFilteringProperties(window))
|
||||||
|
{
|
||||||
|
return ProcessabilityType::LaunchedByProjects;
|
||||||
|
}
|
||||||
|
|
||||||
return ProcessabilityType::Processable;
|
return ProcessabilityType::Processable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ namespace FancyZonesWindowProcessing
|
|||||||
NonProcessablePopupWindow,
|
NonProcessablePopupWindow,
|
||||||
ChildWindow,
|
ChildWindow,
|
||||||
Excluded,
|
Excluded,
|
||||||
NotCurrentVirtualDesktop
|
NotCurrentVirtualDesktop,
|
||||||
|
LaunchedByProjects
|
||||||
};
|
};
|
||||||
|
|
||||||
ProcessabilityType DefineWindowType(HWND window) noexcept;
|
ProcessabilityType DefineWindowType(HWND window) noexcept;
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
#include <common/logger/logger.h>
|
#include <common/logger/logger.h>
|
||||||
#include <common/utils/winapi_error.h>
|
#include <common/utils/winapi_error.h>
|
||||||
|
|
||||||
|
#include <modules/Projects/WindowProperties/ProjectsWindowPropertyUtils.h>
|
||||||
|
|
||||||
// Zoned window properties are not localized.
|
// Zoned window properties are not localized.
|
||||||
namespace ZonedWindowProperties
|
namespace ZonedWindowProperties
|
||||||
{
|
{
|
||||||
@@ -122,3 +124,9 @@ void FancyZonesWindowProperties::SetTabSortKeyWithinZone(HWND window, std::optio
|
|||||||
::SetPropW(window, ZonedWindowProperties::PropertySortKeyWithinZone, rawTabSortKeyWithinZone);
|
::SetPropW(window, ZonedWindowProperties::PropertySortKeyWithinZone, rawTabSortKeyWithinZone);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FancyZonesWindowProperties::RetrieveFilteringProperties(HWND window)
|
||||||
|
{
|
||||||
|
HANDLE handle = ::GetProp(window, ProjectsWindowProperties::Properties::LaunchedByProjectsID);
|
||||||
|
return handle != nullptr;
|
||||||
|
}
|
||||||
|
|||||||
@@ -27,5 +27,7 @@ namespace FancyZonesWindowProperties
|
|||||||
|
|
||||||
std::optional<size_t> GetTabSortKeyWithinZone(HWND window);
|
std::optional<size_t> GetTabSortKeyWithinZone(HWND window);
|
||||||
void SetTabSortKeyWithinZone(HWND window, std::optional<size_t> tabSortKeyWithinZone);
|
void SetTabSortKeyWithinZone(HWND window, std::optional<size_t> tabSortKeyWithinZone);
|
||||||
|
|
||||||
|
bool RetrieveFilteringProperties(HWND window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user