Mac loses window positions when you lock it

27 October 2026 · Martín Acuña Lledó · Applies to macOS 13 Ventura through macOS 27

You lock the Mac, go for a coffee, come back five minutes later, and every window from your external monitors is piled on the laptop screen or on one of the monitors. You did not sleep the Mac, you did not unplug anything, you only locked it. It happens to people with one external monitor and to people with three, on MacBooks, Mac minis and Mac Studios. Here is why, how to confirm it on your own Mac, and what you can do about it.

Why locking moves your windows

Locking the screen is not the problem by itself. What moves the windows is what happens a little later: macOS turns the displays off to save power, and many monitors take that as a signal to go to sleep too.

That is why the same desk can behave differently from day to day: it depends on whether the monitors had time to fall asleep while you were away. A quick lock and unlock often leaves everything alone; a long lunch usually does not. HDMI monitors tend to stay connected while asleep, which is why some people only see this on one of their screens.

Check it on your Mac

Two Terminal commands show what is going on. The first prints how many minutes of inactivity it takes for macOS to turn the displays off:

pmset -g | grep displaysleep

The second lists when the displays were actually turned off and on:

pmset -g log | grep "Display is turned"

If the times your windows moved match a "Display is turned off" line, you are looking at this problem. Locking with Control-Command-Q and walking away is enough to trigger it once the display timer runs out.

Settings that stop it

The goal of every fix below is the same: keep the monitors from disconnecting while you are away.

More options, including dummy plugs and scripts, are in every fix for windows moving after sleep.

What those settings do not fix

Keeping the displays awake solves the lock case, but only that one. Your windows still move when:

The settings also have a cost: monitors that stay on all day while you are away, or a cable choice you would not otherwise make.

How Many Displays handles it

Many Displays takes the other route: it lets the monitors sleep and puts the windows back afterwards. It saves where every window is as you work, within about a second and a half of a change. The moment the Mac locks, sleeps, a display sleeps or a display disconnects, saving freezes, so the mess macOS makes while you are away is never recorded.

When you come back and the displays have been stable for a few seconds, it returns every window to its physical display, position and size, in several quick passes because macOS keeps nudging windows for a while after a wake. If macOS also changed the arrangement, the main display, the resolution or the rotation, those are put back first. For three minutes after a restore, moves nobody asked for are undone. You do not save layouts or press a shortcut; there is one (Control-Option-Command-R) if you ever want to restore on demand.

One thing it cannot do: since macOS 14.5 no app can move another app's window to a different desktop (Space) without disabling System Integrity Protection, so it restores display, position and size, not the desktop.

Download the free trial How it works

Questions

Why do my windows move when I lock my Mac?

Locking the Mac usually turns the displays off a moment later. A DisplayPort, USB-C or Thunderbolt monitor that turns off drops its link, macOS treats that as the monitor being unplugged and moves its windows to a display that is still there. When you unlock, the monitor comes back but macOS does not move the windows back.

How do I stop windows moving when I lock the screen?

Keep the displays from turning off while you are away: set Turn display off when inactive to Never in Lock Screen settings and lock with a screen saver, or turn off the deep sleep option in the monitor's menu. Both keep the link alive, so macOS sees no disconnect. Neither helps when the Mac itself sleeps or you unplug a dock.

Is this a bug in my monitor or my cable?

Usually not. It happens with DisplayPort and Thunderbolt monitors from every brand, because the link really drops when the panel sleeps. HDMI monitors tend to stay connected while asleep, which is why some people only see it on one of their screens.

Does it happen on macOS 26 and 27?

Yes. As of October 2026 no macOS release has changed how windows are placed when a display disconnects and comes back.