Skip to content

The Griddler is a lightweight window management tool for Windows that allows you to snap windows to a configurable grid using your mouse. Inspired by WindowGrid.

Notifications You must be signed in to change notification settings

derac/TheGriddler

Repository files navigation

icon The Griddler

The Griddler is a lightweight window management tool for Windows that allows you to snap windows to a configurable grid using your mouse. Inspired by WindowGrid.

usage example

Drag and drop window tiling

settings

Simple settings

🚀 For Users

How to Use

  1. Put the exe anywhere you want.
  2. Double click to run it.
  3. While dragging a window by holding left click, right click in the grid section you want to resize from, continue dragging left click to the grid section you want to resize to and press right click again or let go of left click.
  4. Double click the quickbar icon to launch settings. {692DF108-4142-40C0-B454-73C4C36FF198}
  5. Settings will be saved in your %appdata% folder.
  6. If you select the option to run at startup, it will make an entry in shell:startup (you can go there in file explorer).

💻 For Developers

Prerequisites

  • Visual Studio 2022 or VS Code.
  • .NET 10.0 SDK.
  • Windows OS (Required for Win32 API and WPF).

Building the Project

  1. Clone the repository.
  2. Open a terminal in the project root.
  3. Run the following commands:
    dotnet build
    dotnet run

Project Structure

  • MainController.cs: The core engine that handles global input hooks and coordinates window snapping logic.
  • WindowManager.cs: A wrapper around Win32 APIs for window manipulation, DPI awareness, and monitor info.
  • GridOverlay.xaml: The WPF window that renders the grid lines and selection rectangle.
  • Settings.cs: Manages persistent user preferences (JSON-based).
  • GlobalHook.cs: Handles low-level mouse hooks to detect dragging and clicking outside the app.

Key Technologies

  • WPF: Used for the UI and overlay.
  • Win32 API: Used for low-level window management (SetWindowPos, GetWindowRect, etc.).
  • Global Mouse Hook: Used to intercept mouse events while other windows are focused.

🛠 Maintainability & Design

The codebase is designed with a separation of concerns:

  • UI Logic is kept in XAML and its code-behind.
  • Native Interop is centralized in WindowManager.cs.
  • Application State is managed via the Settings singleton with INotifyPropertyChanged for reactive UI updates.

📜 Credits

  • Created by derac.
  • Inspired by WindowGrid by Joshua Wilding.

Happy Gridding!

About

The Griddler is a lightweight window management tool for Windows that allows you to snap windows to a configurable grid using your mouse. Inspired by WindowGrid.

Resources

Stars

Watchers

Forks

Languages