Skip to content

Commit

Permalink
FancyZones: if window is not interesting, allow Windows snap
Browse files Browse the repository at this point in the history
  • Loading branch information
bzoz committed Feb 3, 2020
1 parent 25e882e commit 1f390c8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/modules/fancyzones/lib/FancyZones.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ struct FancyZones : public winrt::implements<FancyZones, IFancyZones, IFancyZone
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;
Expand Down Expand Up @@ -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);
}
}
}
Expand Down Expand Up @@ -735,7 +734,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))
Expand All @@ -747,9 +746,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
Expand Down

0 comments on commit 1f390c8

Please sign in to comment.