Why your Mac moves windows after sleep (and how to stop it)
You come back to your desk, wake the Mac, and every window is piled on the laptop screen. The external monitor is on. Your layout is gone.
Updated October 22, 2026 · 5 min read
The short answer
When your Mac or your monitor goes to sleep, the external display can drop its connection for a moment. To macOS, that looks exactly like unplugging it. So it does what it always does when a screen disappears: it moves every window from that screen onto the ones that are left — usually the built-in display.
When the monitor comes back a few seconds later, macOS doesn’t always move the windows back. Sometimes it does, sometimes it moves half of them, sometimes none. That inconsistency is what makes it so annoying.
Why it’s worse in some setups
- Longer sleeps. A quick sleep often comes back fine. After a long one, monitors go into a deeper power state and take longer to reconnect, and the layout is more likely to be lost.
- Docks and hubs. A USB-C or Thunderbolt dock adds one more device that has to wake up and renegotiate the connection.
- Two or more monitors. If they wake in a different order, macOS can briefly see a different arrangement than the one you had.
- Clamshell mode. With the lid closed, the built-in screen is off. When the external monitor drops, the Mac may have no screen at all for a moment.
- Two desks. If you move between home and office, macOS has no notion of “the layout I use at this desk.”
What helps without installing anything
- Use the same ports every time. Plugging the same monitor into a different port can make it look like a different setup.
- Keep the display from sleeping while you’re docked. On a MacBook, look in System Settings → Displays → Advanced for the option that prevents automatic sleeping on power adapter when the display is off. Fewer disconnects means fewer shuffles. The trade-off is power use.
- Assign apps to a desktop. Right-click an app in the Dock → Options → Assign To. This helps with Spaces, not with exact positions or sizes.
None of these remember where each window was. They only reduce how often the layout breaks.
What doesn’t help
- Restarting the Mac. It reopens windows where apps last saved them, which is often the laptop screen.
- Turning off “Displays have separate Spaces.” It changes how Spaces behave across monitors; it doesn’t make macOS remember positions.
The fix: let something remember the layout for you
The real fix is to remember where every window was for each monitor setup, and put it back when that setup returns. That’s what Deskback does. It watches for sleep, wake and display changes, waits for macOS to settle, then restores every window to the position and size it had — including several windows of the same app. If it isn’t sure which window is which, it leaves it alone.
It runs in the menu bar, needs only the Accessibility permission, and nothing leaves your Mac.
Get early access — $9 launch price
FAQ
Why does my Mac move windows after sleep?
When the Mac or the display sleeps, an external monitor can briefly disconnect. macOS moves its windows to the screen that is left and doesn’t always move them back when the monitor returns.
Is there a setting in macOS to stop it?
There’s no single setting that remembers window positions per monitor. Keeping the same ports and avoiding display sleep while docked helps; an app can restore the layout automatically.
Does this happen with an Apple Studio Display too?
It can happen with any external display, because the cause is the display reconnecting, not the brand.
Related
External monitor rearranges your windows on Mac? Fixes that work