Why some window restore apps save the mess instead of your layout
12 November 2026 · Martín Acuña Lledó · Applies to macOS 13 Ventura through macOS 27
You installed an app to put your windows back after sleep. It works when you unplug a monitor and plug it back in a minute later. But after a night's sleep, or a long lunch with the Mac locked, everything is still piled on one screen, or the app proudly puts every window back exactly where macOS dumped them. The app is not broken in an obvious way: it is restoring what it saved. It just saved at the wrong moment. This page explains why that happens, what one open source tool found when its developer looked into it, how to test the tool you use, and what helps without any app.
Why the timing matters
A window restore app does two things: it saves where your windows are, and later it moves them back. The second part only works if the first one happened while the layout was still right.
- macOS moves windows first. When a DisplayPort, USB-C or Thunderbolt monitor sleeps, it usually drops its link, and to macOS that is the same as unplugging it. macOS moves the windows of that monitor to a display that is still there, right away. The lock case is in Mac loses window positions when you lock it.
- Apps hear about it after. The notifications an app gets when the displays change arrive once the change has happened. An app that reacts by saving can read the positions after macOS has already moved the windows.
- A timer saves whatever is on screen. An app that saves every few seconds or minutes keeps saving while you are away. If the monitors went off ten minutes into a lock and the app saved after that, the last thing it stored is the pile. When you come back, it restores the pile.
So two questions decide whether a tool can work after sleep: does it stop saving before macOS moves anything, and does it keep the last layout from before the disconnect instead of the newest one?
What Memmon's developer found
Memmon is a small free, open source app that describes itself as a simple daemon that restores your window positions on external monitors. Its GitHub issue 11, "Does not restore windows after sleep mode", opened in January 2023, is a clear public record of this problem. The reporter found that unplugging and replugging a monitor worked, but after closing the lid or letting the MacBook sleep, the windows stayed on the laptop screen. Others reported the same on macOS 12 and 13.
After testing, the developer wrote that the app only gets screen change events after a display was attached or detached, when it is already too late to store the window positions. It had worked only because macOS was sometimes slow to update the windows, so the app could read the old positions in the meantime. Closing the lid moves them almost instantly. The developer concluded that the only fix would be to store positions ahead of time, every second, and chose not to, because it would use CPU all the time for nothing. The issue is still open.
That is not a criticism of Memmon, which says plainly what it does. It is the clearest explanation I have found of why "restore on reconnect" is the easy half, and "save before the disconnect" is the hard one.
How to test your app
You do not need to read any code. Check the app's own site or settings for when it saves, then try this at your desk:
- Arrange a few windows on each monitor and leave them for a minute, so the app has had time to save the good layout.
- Lock the Mac and stay away. Wait until the monitors have been off for several minutes, and longer than any save interval the app mentions.
- Unlock and wait a few seconds. If the windows come back, it handled the lock. If they stay piled up, or the app moves them back into the pile, it saved after the disconnect.
- Repeat with real sleep and, on a MacBook, with the dock. Close the lid or choose Sleep, wait, then wake. Unplug the dock for a few minutes, then plug it back in. Each one disconnects the monitors in a different way.
If it only fails after long waits, the app probably saves on a timer. If it fails even after a short sleep or a lid close, it probably saves when it hears about the change, which is too late.
Fixes without an app
The surest way to avoid saving the mess is to avoid the mess. These keep the monitors connected, so there is nothing wrong to record:
- Keep the displays awake while locked. In System Settings → Lock Screen, set "Turn display off when inactive" to Never, and use a password-protected screen saver. The monitors stay connected during a lock.
- Turn off deep sleep in the monitor's menu. Options like "DisplayPort deep sleep" or "Auto standby" on many Dell, LG and BenQ monitors keep the link up when the monitor itself sleeps.
- Turn off "Displays have separate Spaces" in System Settings → Desktop & Dock → Mission Control. A window's desktop then survives the disconnect, even if its display does not.
None of these helps with real sleep, closing the lid or unplugging a dock: those are real disconnects, and something has to put the windows back. The full list is in every fix for windows moving after sleep.
How Many Displays handles it
Many Displays was built around this exact problem. It saves as you work, within about 1.5 seconds of a window moving, plus a light check every 20 seconds. The moment the Mac locks, starts to sleep, the displays sleep, or a display configuration change begins, it freezes saving and drops any save that was about to happen, so the layout macOS makes during the disconnect is never recorded. On lock and sleep it also writes the last good layout to disk.
When you come back and the displays have been stable for a few seconds, it puts back the arrangement, resolution and every window from that last good layout. For three minutes after a restore, changes nobody asked for, such as macOS nudging a window back, are undone instead of saved.
Where it does not help:
- A move in the last moment before a disconnect may be missed. If you drag a window and pull the cable within about a second and a half, that last move may not have been saved yet.
- While paused, it does not save or freeze. If you pause it from the menu, the protection is off until you resume.
- It cannot change a window's desktop. Since macOS 14.5 no app can move another app's window to a different Space without disabling System Integrity Protection, so it restores display, position and size. More in desktops move to the wrong monitor after lock.
If you use another window tool too, turn off its automatic restore while you try this one, so two apps are not moving the same windows. The free trial lasts 14 days, with no account and no card.
Download the free trial How it works
Questions
Why does my window app restore the wrong layout after sleep?
macOS moves the windows of a disconnected monitor almost as soon as it disappears. If the app saves positions after that moment, because it saves on a timer or when it hears about the change, it stores the pile macOS made. When the monitor comes back, it faithfully restores the pile.
Why does it work when I unplug the monitor but not after sleep?
Timing. In the Memmon issue about this, its developer explains that the app only hears about a display change after it happens, and it worked only because macOS was sometimes slow to move the windows. Closing the lid or sleeping moves them too fast for that to work.
How can I test my window app?
Arrange your windows, lock the Mac and wait until the monitors have been off for several minutes, longer than any save interval the app mentions. Then unlock. If the windows stay piled up, or the app restores them piled up, it saved after the disconnect.
Can I avoid the problem without an app?
Partly. If the monitors never disconnect, there is no pile to save: keep the displays awake with a screen saver while locked and turn off deep sleep in the monitor's menu. That covers locks and idle time at the desk, not real sleep, closing the lid or unplugging a dock.