The Challenge
Anyone who uses a MacBook with an external display knows the problem: when the display is unplugged, macOS moves the windows to the built-in display but often leaves them stuck behind the Dock. Every window then has to be resized or moved by hand.
Until then, we had used a well-known window management tool for this ourselves. It is no longer maintained, runs on Macs with Apple silicon only through the Rosetta translation layer and had to be started manually after every restart. A replacement that solves exactly these two tasks, keeping windows above the Dock and offering fixed areas per display, was missing.
Our Solution
We developed Dockfit as our own native macOS app, written in Swift with AppKit and SwiftUI. The app lives in the menu bar and works through the macOS accessibility interface.
Windows Above the Dock
Dockfit detects when a display is connected or disconnected, the resolution changes or the Mac wakes from sleep. The app then moves every window into the visible area of its display, below the menu bar and above the Dock. Because macOS sometimes repositions the Dock only seconds after a display is unplugged, Dockfit keeps watching the visible area for a while and tidies up again if needed. A keyboard shortcut does the same manually at any time.
Layouts per Display
- Draw on screen: create, move and resize areas directly on each display
- Grid: all edges snap into place so windows side by side or stacked end up exactly the same width
- Display recognition: each display is uniquely identified and has its own layouts
- Thumbnail while dragging: a small version of the display with all its areas appears at the bottom center; drag the window onto an area and it fills exactly that space
- Optional modifier key: the thumbnail appears either always or only while holding ⌃, ⌥ or ⇧
Release
Dockfit is a universal app for Apple silicon and Intel, signed with our Developer ID and notarized by Apple. Updates are delivered via Sparkle with signed packages. The app collects no data; its only connection is the update check with barnicom.de.
The Result
- No more windows behind the Dock after unplugging a display
- Fixed work areas for each display, drawn in seconds
- Native and lightweight: about 2 MB, no Rosetta, no background service other than the app itself
- Free for all Mac users on macOS 14 or later: Download Dockfit