Skip to content

Repository files navigation

Fit for Windows

Snap Windows windows with the keyboard. Fit for Windows is the Windows counterpart of Fit for macOS.

The repository is named fit-windows; the installed application is simply Fit.

日本語版 README

Status

This repository contains the first working foundation. It currently provides:

  • Win + Left/Right/Up/Down override while Fit is running
  • half, two-thirds, and one-third size cycling
  • quarter snapping by pressing perpendicular directions in sequence
  • work-area-aware placement (taskbar excluded)
  • multiple-monitor support for the active window
  • a notification-area menu with pause, About, and Quit
  • no third-party runtime or library dependencies

Settings UI, drag-to-edge previews, login startup, and signed releases are planned next.

Default shortcuts

Action Shortcut
Left / right sizing cycle Win + Left / Win + Right
Top / bottom sizing cycle Win + Up / Win + Down
Quarter Press horizontal and vertical directions in sequence

Each directional shortcut cycles through 1/2 → 2/3 → 1/3. For example, press Win + Left, then Win + Up, to move the focused window to the top-left quarter.

Fit intercepts only Win + Arrow. Other Windows shortcuts, including Win + Shift + Arrow, remain available. Pause the override from the notification-area menu to restore the standard Windows Snap behavior without quitting Fit.

Build

Requirements:

  • Windows 10 version 2004 or later, or Windows 11
  • .NET 8 SDK
git clone https://github.com/EitaroY/fit-windows.git
cd fit-windows
dotnet build Fit.sln --configuration Release

Run:

dotnet run --project src/Fit/Fit.csproj

Run the dependency-free core tests:

dotnet run --project tests/Fit.Core.Tests/Fit.Core.Tests.csproj

How it works

Fit uses public Windows APIs only:

  • WH_KEYBOARD_LL to intercept the four Windows Snap shortcuts
  • GetForegroundWindow to select the active window
  • MonitorFromWindow and GetMonitorInfo to obtain the usable screen area
  • SetWindowPos to move and resize the window

The keyboard hook performs no window work itself; it immediately queues the action onto the application dispatcher. Closing Fit removes the hook and leaves Windows settings unchanged.

Windows prevents a normal process from controlling some elevated applications. Fit intentionally does not request administrator privileges by default.

Distribution model

The intended model matches Fit for macOS:

  • developers may clone and build the GPL source themselves
  • signed binaries may be published on GitHub Releases
  • an official packaged build may be sold through Microsoft Store

Microsoft Store packaging and commerce do not change the name shown by the installed application: it remains Fit. The Store listing may need a longer unique product name if Fit is unavailable for reservation.

Project structure

src/Fit.Core/          Platform-independent layout calculations
src/Fit/               WPF application and Win32 integration
tests/Fit.Core.Tests/  Dependency-free executable test suite
docs/DESIGN.md         Architecture and implementation decisions

License

GPL-3.0-only. See LICENSE.

Copyright © 2026 Eitaro Y.

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages