FancyZones: if window is not interesting, allow Windows snap (#1186)

Do not swallow WinKey+Arrow events for non-interesting windows. This makes apps that are in the "excluded apps" list behave as if "Override windows snap keys" is disabled - they will react to the Windows default snap.
This commit is contained in:
Bartosz Sosnowski
2020-02-06 13:12:59 +01:00
committed by GitHub
parent 0ecfbfad53
commit 5d8e894802
2 changed files with 5 additions and 4 deletions

View File

@@ -102,7 +102,7 @@ private:
void MoveWindowsOnDisplayChange() noexcept;
void UpdateDragState(require_write_lock) noexcept;
void CycleActiveZoneSet(DWORD vkCode) noexcept;
void OnSnapHotkey(DWORD vkCode) noexcept;
bool OnSnapHotkey(DWORD vkCode) noexcept;
void MoveSizeStartInternal(HWND window, HMONITOR monitor, POINT const& ptScreen, require_write_lock) noexcept;
void MoveSizeEndInternal(HWND window, POINT const& ptScreen, require_write_lock) noexcept;
void MoveSizeUpdateInternal(HMONITOR monitor, POINT const& ptScreen, require_write_lock) noexcept;
@@ -281,8 +281,7 @@ IFACEMETHODIMP_(bool) FancyZones::OnKeyDown(PKBDLLHOOKSTRUCT info) noexcept
{
// Win+Left, Win+Right will cycle through Zones in the active ZoneSet
Trace::FancyZones::OnKeyDown(info->vkCode, win, ctrl, false /*inMoveSize*/);
OnSnapHotkey(info->vkCode);
return true;
return OnSnapHotkey(info->vkCode);
}
}
}
@@ -755,7 +754,7 @@ void FancyZones::CycleActiveZoneSet(DWORD vkCode) noexcept
}
}
void FancyZones::OnSnapHotkey(DWORD vkCode) noexcept
bool FancyZones::OnSnapHotkey(DWORD vkCode) noexcept
{
auto window = GetForegroundWindow();
if (IsInterestingWindow(window))
@@ -767,9 +766,11 @@ void FancyZones::OnSnapHotkey(DWORD vkCode) noexcept
if (iter != m_zoneWindowMap.end())
{
iter->second->MoveWindowIntoZoneByDirection(window, vkCode);
return true;
}
}
}
return false;
}
void FancyZones::MoveSizeStartInternal(HWND window, HMONITOR monitor, POINT const& ptScreen, require_write_lock writeLock) noexcept