Contents
The two systems
Gaps between windows is the visible setting. It inserts a margin around every snapped window, so tiled windows have space between them and away from the display edges.
Screen edge gaps are hidden values that reserve space at each edge of the display which no window will ever cover. They exist for people running a dock replacement, a menu bar replacement, or a status bar that must not be overlapped.
They compose. A window in the left half of a screen with an 8-pixel window gap and a 10-pixel left edge gap starts 18 pixels from the physical edge. This is the arithmetic behind most reports that windows are the wrong size.
# reserve space at each edge
defaults write com.knollsoft.Rectangle screenEdgeGapTop -int 10
defaults write com.knollsoft.Rectangle screenEdgeGapBottom -int 10
defaults write com.knollsoft.Rectangle screenEdgeGapLeft -int 10
defaults write com.knollsoft.Rectangle screenEdgeGapRight -int 10
killall Rectangle && open -a Rectangle
Keeping maximise flush to the edge
By default the between-windows gap also applies to maximise and maximise-height. This is the cause of the frequent complaint that a maximised window does not reach the screen edge — which looks like a bug and is a setting.
# exclude maximise from gaps
defaults write com.knollsoft.Rectangle applyGapsToMaximize -int 2
# exclude maximise-height as well
defaults write com.knollsoft.Rectangle applyGapsToMaximizeHeight -int 2
Most people who use gaps want exactly this: breathing room between tiled windows, and a maximise that genuinely fills the display. It is worth setting on day one.
Notched displays
On a MacBook with a notch, the usable area at the top is already reduced. Applying the same top gap as on an external monitor over-reserves. There is a dedicated value for it:
defaults write com.knollsoft.Rectangle screenEdgeGapTopNotch -int 5
And where only one display needs edge reservations — the common case being a dock replacement on the main screen while external monitors have nothing — the whole edge-gap system can be limited:
defaults write com.knollsoft.Rectangle screenEdgeGapsOnMainScreenOnly -bool true
A small notch-specific top gap, main-screen-only edge gaps, and maximise excluded from gaps. That produces tidy tiling on the laptop panel, untouched geometry on externals, and a maximise that reaches the edge everywhere.
Choosing values
| Gap size | Effect | Suits |
|---|---|---|
| <code>0</code> | Windows meet exactly | Dense work, small displays, busy wallpaper |
| <code>4–6</code> | A visible hairline of separation | Laptops and 24-inch displays |
| <code>8–12</code> | Clear separation, reads as designed | 27-inch and larger |
| <code>16+</code> | Decorative | Large displays with few windows |
There is a real readability argument here rather than just taste. With windows flush against one another, the boundary between two documents is a single hairline and on a dense display the eye occasionally loses track of which pane it is in. Six to ten pixels removes that ambiguity.
The counter-argument is equally real: on a laptop, every pixel spent on a gap is a pixel not spent on text, and a busy wallpaper showing through gaps is worse than no gap at all. Zero is a legitimate choice.
Interaction with resize commands
Gaps make the incremental resize commands ambiguous. Their default behaviour keeps edges that touch the screen fixed and moves only the free edge — but with gaps in play, no edge actually touches anything. The resolution is a setting:
# traditional floating resize — both edges move
defaults write com.knollsoft.Rectangle curtainChangeSize -int 2
If Make Larger and Make Smaller have felt unpredictable since you enabled gaps, this key is the explanation.
Dock replacements and status bars
The original purpose of edge gaps. If you run a dock replacement, a tiling status bar, or any always-visible strip, reserve exactly its height or width on the appropriate edge and no window will ever hide underneath it.
- Measure the actual height of the bar rather than guessing. Take a screenshot and inspect it if necessary.
- Add two to four pixels of clearance so windows do not sit flush against it.
- If the bar is only on one screen, use the main-screen-only setting.
- If the bar auto-hides, reserving space defeats the point of auto-hiding — decide which behaviour you actually want.
Todo Mode is a related but distinct mechanism: it reserves space for a specific application window rather than a fixed strip, and it applies to the primary display only. Both can be used together, though the arithmetic gets involved.
Get the current build
Rectangle is free and open source. Everything documented here works in the standard build.
Download from rectangleapp.comQuestions
Why does maximise not reach the screen edge?
The between-windows gap applies to maximise by default. Set applyGapsToMaximize to 2.
What is the difference between the two gap types?
Window gaps go around every snapped window. Edge gaps reserve space at the display boundary that nothing may cover.
Do gaps cost performance?
No. They are an offset applied when a window is positioned.
Can gaps differ per display?
Not per display individually, but edge gaps can be restricted to the main screen, and the notch has its own top value.