Clamshell mode guide

Keep window positions when you close the MacBook lid.

Closing or opening the lid reshuffles your windows. Save a layout for each lid state and let the right one come back.

Clamshell mode is a great way to use a MacBook at a desk: lid closed, external monitor, keyboard, and mouse. The annoying part is what happens to your windows. Close the lid and windows rearrange onto the external display. Open it again and windows move to the laptop screen, often in an order you did not pick. Every switch means dragging things back.

Short version: closing or opening the lid changes which displays macOS sees, so it moves windows around and does not reliably put them back. Try the free options first. SnapState can save one layout for lid closed and one for lid open and restore each automatically when that display layout appears.

Why windows move when switching to clamshell mode

When you close the lid with an external display attached, the built-in screen goes away. macOS generally treats that like a display being disconnected: windows that were on the built-in screen are moved onto the external monitor, and the display arrangement is rebuilt around what is left.

When you open the lid, the built-in display comes back and macOS re-detects everything. It does not reliably send each window back to its earlier display and position, and the built-in screen may become the main display again, so windows often pile up on the laptop screen. If the problem also shows up when the Mac simply sleeps, see windows moving to one screen after sleep.

Free and manual workarounds

  • Drag windows back by hand. Free and reliable if you only switch now and then.
  • Check the display arrangement for each lid state.In System Settings > Displays, confirm the arrangement and main display with the lid open, then check again in clamshell mode, so macOS treats your monitors consistently.
  • If you use Spaces.The Displays have separate Spaces option in System Settings > Desktop & Dock, and assigning apps to a desktop from the Dock icon Options menu, can help some setups.
  • Try Stay. Stay by Cordless Dog is free since version 1.5.1. It can store a set of window positions for each combination of displays, such as lid open with monitor and lid closed with monitor, and restore them automatically as displays change. If Stay covers your needs, it is a good free choice. Read SnapState vs Stay for the differences.

How SnapState keeps your layout, step by step

  1. Arrange your windows in clamshell mode. With the lid closed and the external monitor or monitors in use, put each window where you want it.
  2. Save it as a lid closed workspace. Capture the setup from the SnapState menu bar app and name it something like Clamshell desk.
  3. Open the lid and save a second workspace. Open the lid, arrange windows across the built-in screen and the external display the way you like, and save that as another workspace such as Lid open. Save a Laptop only workspace too if you often undock.
  4. Arm each workspace for its display layout. Set each workspace to restore when its matching display layout appears, so closing or opening the lid brings back the arrangement for that setup. Add the wake from sleep trigger if you usually close the lid and wake the Mac from the keyboard.
  5. Switch by hand whenever you like. Pick a workspace from the menu bar or press its Control-Command-1 to 6 shortcut to switch without touching the lid.

SnapState is a native macOS menu bar app. Each workspace records the visible windows on the current desktop with position and size, the apps needed to relaunch them, the monitor and display layout, and the active tab URL of each window in Safari, Chrome, Edge, Brave, Arc, and Chromium once Automation permission is granted. Because it knows the display layout each workspace was saved for, the matching display layout trigger is a natural fit for lid open and lid closed. If you undock completely, the monitor unplugged guide covers the monitor connect and disconnect triggers.

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.5.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/.

Honest limitations

SnapState saves and restores only the visible windows on the current desktop, so it does not save or restore macOS Spaces. Firefox is not supported, and only the active tab URL per supported browser window is restored, not full tab sets. It is not a tiling or snapping window manager: it recalls arrangements you made. It requires macOS 15.7 or later.

Common questions

Why do my windows rearrange when I close my MacBook lid?

Closing the lid in clamshell mode removes the built-in display from the setup, so macOS generally moves any windows that were on it onto the external monitor. The whole display arrangement changes at the same time, and macOS does not reliably remember where every window was for each arrangement.

Why does opening the lid move all my windows to the laptop screen?

Opening the lid adds the built-in display back. macOS re-detects the displays and can shuffle windows between them, sometimes treating the built-in screen as the main display again, so windows often end up on the laptop screen instead of where they were on the external monitor.

Is there a free way to keep window positions in clamshell mode?

Check the display arrangement and main display in System Settings > Displays for both lid open and lid closed setups, and try Stay by Cordless Dog. Stay has been free since version 1.5.1 and stores window positions for each display combination, restoring them automatically as displays connect and disconnect.

How does SnapState keep windows in place when switching to clamshell mode?

Save one workspace with the lid closed and one with the lid open, then arm each to restore when its matching display layout appears. SnapState moves the saved windows back, relaunches missing apps, and remaps saved frames onto the current displays if the setup differs.

What does SnapState not do in clamshell mode?

It restores only the visible windows on the current desktop, so it does not save or restore macOS Spaces. Firefox is not supported, only the active tab URL per supported browser window is restored, it is not a tiling window manager, and it requires macOS 15.7 or later.

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