Maximized Window Margins
Leaves a configurable gap around maximized windows and between snapped windows, macOS style
Author: Mário Barbosa

Maximized windows no longer touch the screen edges. A configurable gap is kept
on every side, which pairs nicely with a floating dock (for example the
Luminosity or DockLike themes of Windows 11 Taskbar Styler). Windows
arranged side by side with Snap / Snap Layouts get a configurable gap between
them too.
How it works
The mod runs as a tool mod (in its own windhawk.exe process, nothing is
injected into other programs). For each monitor and each edge with a margin
greater than zero, it registers an invisible
AppBar
of the configured thickness. Windows then reduces the work area, and every
maximized window fits inside it.
- Margins are set in DIPs and scaled per monitor DPI.
- AppBars are registered again when Explorer restarts, when displays change,
and when the taskbar or another AppBar moves.
- Disabling the mod restores the original work area immediately.
Gaps between snapped windows
When two or more windows share the screen through Snap / Snap Layouts (halves,
thirds, quarters...), the mod keeps the "Gap between snapped windows" between
them. Edges that touch the screen keep the regular margins.
- Resizing works as usual: drag the gap itself, or the edge of a snapped
window, and the windows on both sides resize together while the gap stays
the same. The Windows 11 divider only shows up while snapped windows touch,
so the mod provides its own, which works with any gap size.
- Set the gap to 0 to turn this off.
- Disabling the mod puts snapped windows back where Snap placed them.
Under the hood, the mod watches window moves through an out-of-context
WinEvent hook (still nothing injected) and fills each gap with an invisible
window that handles the dragging.
Side effects
Since the work area itself shrinks, the gap also applies to:
- Snap / Snap Layouts (snapped windows keep the margin too).
- Desktop icon placement.
- Anything else that positions itself from the work area, such as pop-ups and
notifications that apps place in a corner of the screen.
Real fullscreen apps (games, videos, F11) cover the whole monitor and are not
affected.
Tips
- With a floating dock, the taskbar still reserves its own height at the
bottom. The bottom margin is added on top of it, so a small value (0–10)
is usually enough.
- Maximized windows have square corners in Windows 11. To round them, install
Custom Window Corner Radius and set "Rounded corners for maximized and
snapped windows" to "Round snapped and maximized windows". The "Corner
radius" setting of that mod then applies to maximized windows too.