FancyZones: remove dialog boxes filtering (#1076)

* FancyZones: remove dialog boxes filtering

* FancyZones: add the "no owner window" filter to the WinKey + arrow zone snapping
This commit is contained in:
Bartosz Sosnowski 2020-01-20 11:02:12 +01:00 committed by GitHub
parent c1232a7001
commit 62da7c7be4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View file

@ -26,10 +26,7 @@ private:
// List of HWNDs that are not interesting - like desktop, cortana, etc
std::vector<HWND> invalid_hwnds = { GetDesktopWindow(), GetShellWindow() };
// List of invalid window basic styles
std::vector<LONG> invalid_basic_styles = { WS_CHILD, WS_DISABLED, DS_ABSALIGN, DS_SYSMODAL, DS_LOCALEDIT,
DS_SETFONT, DS_MODALFRAME, DS_NOIDLEMSG, DS_SETFOREGROUND, DS_3DLOOK,
DS_FIXEDSYS, DS_NOFAILCREATE, DS_CONTROL, DS_CENTER, DS_CENTERMOUSE,
DS_CONTEXTHELP, DS_SHELLFONT };
std::vector<LONG> invalid_basic_styles = { WS_CHILD, WS_DISABLED };
// List of invalid window extended styles
std::vector<LONG> invalid_ext_styles = { WS_EX_TOOLWINDOW, WS_EX_NOACTIVATE };
// List of invalid window classes - things like start menu, etc.

View file

@ -680,6 +680,10 @@ void FancyZones::CycleActiveZoneSet(DWORD vkCode) noexcept
{
if (const HWND window = get_filtered_active_window())
{
if (GetWindow(window, GW_OWNER) != nullptr)
{
return;
}
if (const HMONITOR monitor = MonitorFromWindow(window, MONITOR_DEFAULTTONULL))
{
std::shared_lock readLock(m_lock);
@ -696,6 +700,10 @@ void FancyZones::OnSnapHotkey(DWORD vkCode) noexcept
{
if (const HWND window = get_filtered_active_window())
{
if (GetWindow(window, GW_OWNER) != nullptr)
{
return;
}
if (const HMONITOR monitor = MonitorFromWindow(window, MONITOR_DEFAULTTONULL))
{
std::shared_lock readLock(m_lock);