Docking guide

MacBook windows rearrange when you connect a dock or monitor.

Why it happens on connect, and how to get the same layout every time you dock.

Short answer

Plugging a MacBook into a dock adds displays, changes resolutions and sometimes changes which screen is main. macOS then places windows its own way. The reliable fix is to save a "Desk" workspace and a "Laptop" workspace in SnapState and let it restore the right one on connect and disconnect.

What happens when you plug in a dock

The Mac sees new displays appear, often one after another, and recalculates the screen layout each time. Windows get moved to fit, and the display order may differ from last time. This page is about connecting. For the opposite, see restoring windows after unplugging a monitor.

Things that make it worse

Hubs driving several displays

Multiple displays through one hub commonly connect at slightly different moments, so windows get shuffled more than once.

Different monitors at home and at work

Each desk is a different screen setup, so one layout cannot fit both. See ultrawide layouts.

Lid closed vs open

Closing the lid removes the built-in screen from the layout. See clamshell mode.

Manual fixes

  • In System Settings, Displays, set the arrangement and main display to match your desk.
  • Assign apps to specific desktops from the Dock Options menu.
  • Plug in the display before waking the Mac, so the layout settles once.

Automatic fix with SnapState

  1. Arrange your windows at the desk the way you like them.
  2. Capture a workspace from the menu bar and name it Desk. Do the same unplugged and call it Laptop.
  3. Restore automatically: turn on the display connect and disconnect triggers, or press Control-Command-1 and 2.

SnapState remaps windows to the displays you have now, relaunches missing apps and reopens your browser tabs. Shortcuts for several layouts are covered in multi-monitor shortcuts.

Home and office: one workspace per desk

Save one workspace for each desk you use. With a matching layout trigger, SnapState restores the one that fits the displays it sees. Comparing tools? See the best Mac workspace managers, Display Maid and Stay, or why windows move after sleep.

See SnapState restore a workspace

Frequently asked questions

Why do my windows rearrange when I connect my MacBook to a monitor?

When a display connects, macOS has to place windows on a new set of screens with new sizes and order. It commonly guesses, and the result rarely matches how you had things last time.

Is there an app that remembers window positions for each monitor setup on Mac?

Yes. SnapState saves a workspace per setup and can restore it automatically when a display connects or disconnects, including the apps and browser tabs. Stay and Display Maid also remember positions per display setup.

Can macOS remember layouts per display setup natively?

Not reliably. macOS has no feature to save a named layout for each display setup and restore it on connect.

Does SnapState work with Intel and Apple Silicon?

Yes. It is a universal app for both and needs macOS 15.7 or later.

How is this different from Display Maid or Stay?

All three restore window positions when displays change. SnapState also relaunches apps, reopens browser tabs, restores on wake, and lets you switch named workspaces with shortcuts.

Get SnapState for $9.99One-time purchase · up to three Macs · 14-day refund