Lock screen guide

Mac windows move after the lock screen.

Unlock the Mac and windows have jumped to another display, even though the computer never slept. Here is why, what to try for free, and how to get the layout back.

Mac windows often rearrange after you lock the screen, after the screensaver, or when the display sleeps, because an external monitor drops its connection while the Mac stays awake. macOS moves those windows onto a display that is still there and usually leaves them there when you unlock. Free settings sometimes keep the display from dropping off. If they do not, SnapState can restore a saved layout when the monitor reconnects.

Recommended fix: SnapState. Save your layout once and arm it for monitor connect or a matching display layout. SnapState puts windows, apps, and browser tabs back when the display returns. $9.99 one-time, up to three Macs. If the Mac itself slept, see windows moving to one screen after sleep.

Short version: a lock or screensaver often turns the display off without sleeping the Mac. DisplayPort and Thunderbolt monitors commonly drop the link, so macOS treats them as unplugged. Try the free settings below first. If windows still jump, SnapState restores the saved layout when the monitor comes back.

Why do Mac windows move after the lock screen?

Control-Command-Q locks the Mac. It does not, by itself, disconnect a monitor that is still showing a picture. The rearrangement usually starts a moment later, when the display turns off. In System Settings > Lock Screen, macOS has separate timers for when the screen saver starts and for Turn display off on battery when inactive and Turn display off on power adapter when inactive. Those timers can fire while you are locked, or while you are simply away from the keyboard, and the computer can stay awake the whole time.

When the picture stops, many external monitors enter their own power saving mode. DisplayPort and Thunderbolt displays often drop the link entirely, which looks the same to macOS as unplugging the cable. macOS moves windows off the missing display onto one that is still available, often the built-in MacBook screen or whichever display remains. Unlocking wakes the panel and macOS detects the monitor again, but it does not reliably restore each window's earlier display and position. That is the same disconnect behavior as unplugging a monitor and as switching a monitor input, triggered by display sleep instead of a cable or an input change. If the whole Mac slept, the matching guide is why Mac windows move after sleep.

What free fixes should you try first?

These are worth trying before you pay for anything. Results vary by Mac, monitor, and cable.

  • Drag windows back by hand. Always works, costs nothing, and is fine if it only happens now and then.
  • Delay display sleep in Lock Screen settings.In System Settings > Lock Screen, lengthen Turn display off on power adapter when inactive and Turn display off on battery when inactive, and delay Start Screen Saver when inactive. Keeping the display on avoids the disconnect. The tradeoff is that the panel stays lit while you are away.
  • Check the display arrangement.In System Settings > Displays, confirm the arrangement matches your desk and that the main display is the one you expect, so macOS treats the monitors consistently when they reappear.
  • If you use Spaces.The Displays have separate Spaces option in System Settings > Desktop & Dock changes how windows are tied to each screen, so it is worth testing both ways. macOS logs you out when you change it. You can also assign an app to a desktop from its Dock icon Options menu.
  • Look at the monitor's own menu. Many monitors have options related to deep sleep, DisplayPort power saving, or automatic input detection. Names vary by model, so check the monitor manual. A monitor that fully powers down is more likely to drop the link.
  • Try Stay. Stay by Cordless Dog has been free since version 1.5.1. It stores window positions for each display combination and can restore them as displays connect and disconnect. If Stay covers your needs, it is a good free choice. See SnapState vs Stay for how the two differ.

How does SnapState put windows back after you unlock?

  1. Arrange your windows while every display is on. Unlock the Mac and wait until each monitor is showing a picture. Put every window on the display and in the position you want back after the next lock.
  2. Save the arrangement as a named workspace. Capture the setup from the SnapState menu bar app and name it something like Desk. It records window positions and sizes, the apps to relaunch, and the display layout.
  3. Arm the workspace for the display coming back. Turn on the monitor connect trigger, and the matching display layout trigger if your monitor is slow to reappear. The Mac often stays awake during a lock or display sleep, so a wake-from-sleep trigger does not cover this case. Use wake as well only if the Mac itself sometimes sleeps.
  4. Lock the screen or let the display sleep, then unlock. When the external display drops off, macOS may pile its windows onto a remaining screen. When the display reconnects, SnapState moves each saved window back to its saved display, position, and size.
  5. Restore by hand if you ever need to. If a window still lands in the wrong place, pick the workspace from the menu bar or press its Control-Command-1 to 6 shortcut.

SnapState is a native macOS menu bar app. A workspace captures windows on every Space with their position and size, the apps needed to relaunch them, the monitor and display layout, and all open tabs of each window in Safari, Chrome, Edge, Brave, Arc, and Chromium once Automation permission is granted. Choose Full to relaunch missing apps, or Layout Only to move windows that are already open. If the display setup differs when you unlock, saved frames are remapped onto the displays you have now.

A lock screen is not a wake event. Arm monitor connect, monitor disconnect, or a matching display layout. Add the wake from sleep trigger only for the separate case where the Mac actually sleeps, covered in windows moving to one screen after sleep.

See SnapState restore a workspace

What are the practical details?

SnapState costs $9.99 as a one-time purchase, with a lifetime license for up to three Macs and a 14-day refund. Version 2.7.2 requires macOS 15.7 or later on Apple Silicon and Intel Macs and ships as a signed, notarized DMG rather than through the Mac App Store. It needs Accessibility permission to move windows, and workspace data stays local on your Mac as JSON in ~/Library/Application Support/SnapState/.

What are the honest limits?

SnapState does not keep a monitor from disconnecting when the display sleeps. It restores the saved layout afterwards. SnapState restores layouts across multiple Spaces (apps go back to the Space they were saved on, full-screen windows return to full screen, and windows on other Spaces are placed when you switch to them). Firefox is not supported, and tabs are restored only from supported browsers. It is not a tiling or snapping window manager, it does not restore on login or restart, and it requires macOS 15.7 or later.

What else should you know?

Why do Mac windows move after I lock the screen?

Locking the screen does not by itself rearrange windows if the displays stay connected. What usually happens is that the display then turns off, from the Lock Screen timer or the screensaver, while the Mac stays awake. Many external monitors, especially DisplayPort and Thunderbolt displays, drop their link when the picture goes away. macOS treats that like an unplugged display and moves those windows onto a screen that is still there. When you unlock and the monitor reconnects, macOS does not reliably send each window back.

Do windows rearrange after the screensaver or when only the display sleeps?

They often do, for the same reason. System Settings > Lock Screen controls when the screen saver starts and when the display turns off on battery and on the power adapter. Turning the display off is not the same as putting the Mac to sleep. A monitor that powers down or loses its DisplayPort or Thunderbolt link looks disconnected, so windows move even though the computer never slept.

Is there a free way to stop windows jumping when the screen locks?

In System Settings > Lock Screen, you can lengthen Turn display off on power adapter when inactive and Turn display off on battery when inactive, and delay when the screen saver starts, so the display stays on. In System Settings > Displays, confirm the arrangement and which display is main. In Desktop & Dock, test Displays have separate Spaces both ways. Some monitors have their own deep-sleep or input-detection options; names vary by model. Stay by Cordless Dog has been free since version 1.5.1 and restores window positions per display setup.

How does SnapState fix windows that moved after unlocking?

Save a workspace while every window is where you want it, then arm it to restore when a monitor connects or when a matching display layout appears. Because a lock or display sleep often leaves the Mac awake, that is the trigger that matches, not wake from sleep. SnapState moves the saved windows back, can relaunch missing apps, remaps saved frames onto the current displays if the setup differs, and reopens all open tabs in Safari, Chrome, Edge, Brave, Arc, and Chromium after Automation permission is granted.

What does SnapState not do here?

It does not stop macOS from treating a sleeping display as disconnected. It puts the saved layout back afterwards. SnapState restores layouts across multiple Spaces (apps go back to the Space they were saved on, full-screen windows return to full screen, and windows on other Spaces are placed when you switch to them). Firefox is not supported, tabs are restored only from supported browsers, it is not a tiling window manager, and it requires macOS 15.7 or later. There is no automatic restore on login or restart.

Where else does this layout break?

The same disconnect shows up when you switch a monitor input, when you unplug a monitor, and when windows pile onto one screen after sleep. The broader causes are in why Mac windows move after sleep. For a free per-display tool, see Stay.

Get SnapState for $9.99One-time purchase · up to three Macs · 14-day refund