Back to blog
Guides6 min read

Mac Window Layout Keeps Resetting? How to Stop Windows Moving When You Dock or Wake Your Mac

macOS scrambles your window positions every time you dock, undock, or wake from sleep. Here's how to stop it and restore layouts automatically.

Appish·

Every time you unplug your MacBook from its monitor, or wake it from sleep, macOS moves your windows — shuffling them onto whichever display it feels like, resizing them, stacking them in a pile on your built-in screen. There is no built-in way to save your window positions and have macOS restore them automatically when your setup changes. Here is what actually works.

Why does macOS keep moving windows when I dock or undock?

When you disconnect an external monitor, macOS has to do something with the windows that were on it — so it dumps them all onto your remaining display, usually resized and overlapping. When you reconnect, it does not remember where anything was. It treats each connection as a fresh start.

This is not a bug Apple is rushing to fix. The operating system has no concept of a "display profile" — it does not know that your desk setup with two monitors is the same setup you use every day. Each time the monitor configuration changes, macOS just reflows windows according to its own rules, not yours.

Sleep and wake can cause similar disruption, particularly with external monitors connected via DisplayPort or docks that briefly disconnect during wake. The monitor re-announces itself, macOS registers a display change event, and windows shift again.

Does macOS Sequoia's built-in window tiling help?

Not really — and this is worth being direct about. Sequoia's window tiling lets you snap windows into halves, quarters, and preset arrangements, but it does not save those arrangements. Tile your windows into a perfect layout, close the lid, come back the next morning, and you are starting from scratch.

Sequoia also introduced a "restore windows" option when reopening apps, but this is per-app and unreliable — it applies to individual app state, not to a multi-app layout across multiple displays. If you have a coding environment with your editor on the left monitor, a browser on the right, and a terminal at the bottom, Sequoia has no mechanism to restore that as a saved configuration.

How to save and restore window layouts automatically on Mac

The only reliable way to do this is with a third-party window manager that understands display profiles. Not all of them do — Rectangle, for example, handles snapping very well but has no concept of saved layouts or monitor detection.

Layoutish is built specifically around this problem. You set up your windows the way you want them, save a named layout, and Layoutish can restore it automatically when it detects the right monitor configuration. The key feature here is display profile detection: Layoutish identifies your monitor setup (by the combination of displays connected) and applies the matching layout without you doing anything. Dock your MacBook and your work layout appears. Undock and switch to your single-screen layout. No manual steps.

For apps that were not already open when you docked, Layoutish launches them and positions them — you do not need to open everything first.

A few things worth knowing before you buy:

  • Layoutish requires macOS 14+ and Accessibility permission (which any window management app needs to move windows on your behalf)
  • Some stubborn apps — ones that resist being repositioned — are handled with smart retry logic, so they land where you expect even if they are slow to launch
  • The current price is $6.99 as a one-time purchase; it rises to $9.99 on 1 September 2026, and existing owners are unaffected

Setting up automatic layout restore when you dock your MacBook

Here is the setup flow that actually works for a dock/undock scenario:

  1. Connect your external monitors and arrange everything — position every window exactly where you want it across all your displays
  2. Open Layoutish from the menu bar and save the current layout with a name like "Desk"
  3. Enable display profile detection — Layoutish will associate this saved layout with your current monitor configuration
  4. Set up your laptop-only layout — disconnect your monitors, arrange your windows for single-screen use, and save that as "Laptop"
  5. Enable auto-apply for both profiles

From that point, Layoutish detects which monitors are connected when you dock or undock and applies the matching layout automatically. You can also trigger any layout instantly with a global hotkey or the Quick Switcher (⌘⇧L) if you want manual control.

Time-based scheduling is also available — so if you want your "Morning" layout applied automatically at 9am on weekdays, that works too.

What about apps that won't stay where I put them?

Some apps — Electron apps like Slack and Notion are common offenders — reposition themselves after launch rather than staying where a window manager puts them. They launch, draw their window, then move it based on their own saved state.

Layoutish handles this with smart positioning retries: it watches for the window to settle and repositions it again after the app has finished doing whatever it is doing. It is not perfect for every app in every situation, but it handles the common cases that trip up simpler window managers.

If an app is particularly stubborn, the workaround is to clear that app's own saved window position data (usually in ~/Library/Saved Application State/) so it stops fighting the layout restore.

Does this work with three or more monitors?

Yes — Layoutish saves layouts across however many displays you have connected. Each saved layout stores the position and size of every window on every screen, and display profile detection works with any monitor combination, not just two-display setups.

For a three-monitor desk setup, you save one layout. For a single-screen laptop mode, you save another. If you have a second desk with a different monitor (different resolution or arrangement), you save a third. Layoutish distinguishes between them based on which displays are present.

Common questions

Why do my windows all end up on my laptop screen when I unplug my monitor?

This is default macOS behaviour — when a display disconnects, all windows on it are moved to the primary internal display. macOS does not save or remember where they were. A window manager with display profile support is the only way to automatically restore them when you reconnect.

Does Rectangle save and restore window layouts?

Rectangle does not save named layouts or detect display configurations. It is excellent for keyboard-shortcut snapping and quick arrangements, but it has no persistent layout memory. If you need layouts that survive a dock/undock cycle, you need a tool like Layoutish that is built for that use case.

Will my apps be relaunched automatically if they were closed when I dock?

Layoutish will attempt to launch missing apps when restoring a layout — if an app in your saved layout is not already open, it opens it and positions it. This means your full desk layout can restore even from a cold start, not just when the apps are already running in the background.

window managementmac layoutsdockingmacOS SequoiaLayoutish