You let your Mac sleep, come back, and every window that was on your external monitor is now stacked on the laptop screen. Here is why that happens, what is worth trying for free, and how to restore your setup without dragging anything.
Why Mac windows move after sleep
When a Mac sleeps, its displays sleep too. On wake, macOS can briefly report fewer displays than you really have connected, because a monitor, dock or adapter takes a few seconds to answer. While a monitor looks missing, macOS moves its windows to a screen that does exist. A moment later the monitor comes back, but the windows usually stay where they were put.
The same thing happens when you unplug a monitor, undock a laptop, or change a display's resolution. Slow docks and long adapter chains make it more likely.
Free things to try first
- Check “Displays have separate Spaces.” It is in System Settings → Desktop & Dock → Mission Control, and it is on by default. Some people report fewer windows and Dock jumps with it on. Changing it needs you to log out and back in.
- Assign apps to a desktop. Right-click an app in the Dock, choose Options → Assign To → This Desktop. This tells macOS which desktop the app belongs to, which can help it return windows to the right screen.
- Try a direct cable or another port. Some users find that a slow USB-C dock or adapter makes the problem worse than a direct connection.
- Update macOS. Display handling changes between releases.
These can reduce how often it happens. None of them remember your layout, so when windows do end up in the wrong place you still have to drag them back.
Put everything back in one click
Layr for Mac is a menu-bar app that saves your window layout and restores it. Arrange your windows the way you like, choose Save current windows, and Layr stores where every window goes, on every display.
- Automatic: in Settings, “When a display connects or changes, rearrange” re-applies your active layout. It is on by default.
- One click: pick the layout in the menu-bar panel, or run Fix My Workspace, which shows which windows would move before anything moves.
- Undo: you can undo the last arrange.
- Missing monitor: you choose whether a disconnected display's windows go to your main display or stay where they are.
In the developer's own test with a MacBook and an HDMI monitor, unplugging the monitor made Layr place the layout's windows on the built-in display within about two seconds. After plugging it back in, the windows were on the monitor in their saved positions. That was one MacBook and one monitor, so docks, sleep and other setups can behave differently.
What Layr does not do
- It does not follow macOS Spaces. The public macOS API reports that the Space changed, but not which one.
- It does not move full-screen windows, and it does not open apps for you.
- It needs the Accessibility permission, because macOS only lets an app move other apps' windows with it.
Want the longer version on displays? Read managing multiple monitors on Mac, or see everything Layr does today.