Mac desktops (Spaces) move to the wrong monitor after lock
1 November 2026 · Martín Acuña Lledó · Applies to macOS 13 Ventura through macOS 27
You keep a desktop per task, maybe a full-screen app on each monitor. You lock the Mac, come back, and the desktops are on other monitors: the full-screen editor is now on the laptop, Mission Control shows desktops in the wrong strip, and switching with Control-arrow lands you on the wrong screen. With three monitors it gets worse. This page explains why Spaces move, how to check your settings, what fixes it, and the part that no app can fix on current macOS.
Why desktops move
- Each monitor owns its desktops. With "Displays have separate Spaces" turned on, which is the default, every monitor has its own row of desktops, and every full-screen app is a desktop of its own on one monitor.
- A sleeping monitor looks unplugged. A few minutes after you lock, macOS turns the displays off. DisplayPort, USB-C and Thunderbolt monitors drop their link when they sleep, and macOS treats that as the monitor being removed. Its desktops and full-screen apps are moved to a display that is still there.
- They do not always go back. When the monitor returns, macOS gives it desktops again, but not necessarily the ones it had. Full-screen apps often stay where they were rescued, and the order of desktops can change.
- Automatic rearranging adds to it. With "Automatically rearrange Spaces based on most recent use" on, macOS also reorders desktops by use, which looks like the same bug.
Windows that are not full screen move too, but that is a separate problem with its own fixes: see Mac loses window positions when you lock it.
Check your Spaces settings
Both settings are in System Settings → Desktop & Dock → Mission Control. You can also read them in Terminal:
defaults read com.apple.spaces spans-displays
This prints 1 when "Displays have separate Spaces" is off (one set of desktops across all displays) and 0 when it is on.
defaults read com.apple.dock mru-spaces
This prints 0 when "Automatically rearrange Spaces based on most recent use" is off and 1 when it is on.
Fixes without an app
- Turn off "Displays have separate Spaces". It is the change that helps most. With it off, a desktop spans every display, so a monitor going to sleep can only change which display a window is on, not which desktop it is on. You log out and back in for it to take effect. The trade-offs: switching desktops switches all monitors at once, and a full-screen app takes over every display, so many people stop using full screen and keep windows maximised instead.
- Turn off "Automatically rearrange Spaces based on most recent use". Same pane. Your desktops stay in the order you set them. Harmless, and it removes the confusion between this and the sleep problem.
- Keep the monitors from disconnecting. Set "Turn display off when inactive" to Never in Lock Screen settings and use a password-protected screen saver, or turn off "DisplayPort deep sleep" in the monitor's menu. If the monitor never drops its link, its desktops never move.
- Assign apps to a desktop. Right-click an app in the Dock, then Options, and choose a desktop. macOS then opens that app's windows on that desktop. It does not stop desktops moving between monitors, but it keeps apps grouped where you expect them.
More options are in every fix for windows moving after sleep.
What no app can fix
Since macOS 14.5, Apple blocks moving another app's windows to a different desktop (Space) unless System Integrity Protection is disabled. The private methods that window tools used to rely on do not work on macOS 26. In practice this means no app can take a window that macOS put on the wrong desktop and send it back to the right one. Turning off "Displays have separate Spaces" avoids most of the problem, because then the desktop never changes, only the display.
How Many Displays handles it
Many Displays remembers which desktop each window was on, along with its display, position and size, and it restores windows on every desktop, not only the one on screen. When the Mac wakes, unlocks or the monitors reconnect, it waits until the displays have been stable for a few seconds, puts the arrangement and the main display back, and returns every window to its display, position and size.
Because of the macOS 14.5 limit above, it cannot move a window from one desktop to another, so it restores display, position and size but not the desktop. If you turn off "Displays have separate Spaces", that is all there is to restore, and everything comes back.
Download the free trial How it works
Questions
Why do my desktops move to another monitor after I lock my Mac?
With Displays have separate Spaces turned on, each monitor has its own desktops. When a monitor sleeps after the lock and drops its link, macOS moves its desktops and full-screen apps to a display that is still there. When the monitor comes back, macOS does not always put them back where they were.
Should I turn off Displays have separate Spaces?
If desktops landing on the wrong monitor bothers you more than having one set of desktops for all screens, yes. With it off, a desktop spans every display, so sleep can only change which display a window is on, not which desktop it is on. It takes effect after you log out and back in.
Can an app move windows back to the right desktop?
Not reliably on current macOS. Since macOS 14.5 Apple blocks moving another app's windows to a different Space unless System Integrity Protection is disabled. Apps can still put windows back on the right display, at the right position and size.
How do I check my Spaces settings from Terminal?
defaults read com.apple.spaces spans-displays prints 1 when Displays have separate Spaces is off and 0 when it is on. defaults read com.apple.dock mru-spaces prints 0 when Automatically rearrange Spaces based on most recent use is off.