Guide · updated November 2026

Why your windows move when you dock your MacBook, and how to fix it

macOS rearranges windows when you connect or disconnect an external display. Here's why it happens, the built-in settings that help, and how to make layouts restore automatically.

Why it happens

When a display disappears, macOS has to put its windows somewhere, so it piles them onto the remaining screen. When the display comes back, macOS doesn't reliably put them back. Sleep and wake can trigger the same shuffle, because some monitors briefly disconnect.

Window managers make this harder or easier. Tilers and scrolling managers that park windows off-screen can see those windows pushed onto the other monitor; Paneru's own README suggests arranging displays vertically to reduce this.

Built-in settings worth checking

System Settings → Desktop & Dock → Mission Control: turn on 'Displays have separate Spaces' so each monitor keeps its own Spaces.

Assign apps to a display: right-click an app's Dock icon → Options → Assign To. This only helps apps that open on a fixed Space.

Make it automatic with Desks

Transom identifies each combination of connected displays (for example 'Built-in Retina Display' versus 'Built-in + LG UltraFine') as a desk. While you work it keeps a snapshot of where each window lives and which mode each display uses. When a known desk reconnects, it waits for macOS to settle, then puts every window back on its display, in Snap positions or in the same order on the Strip.

A new combination gets saved the first time you use it. There's nothing to configure.

Try Transom

Snap or Strip per display, and desks that restore themselves. Free for 14 days.