The missing manual

Why your Mac windows move when you close the lid

Short answer: closing the lid switches off the built-in display, and macOS treats that exactly like unplugging a monitor. Opening it adds the display back, which reshuffles things again. Lid shut and lid open are two different setups, and macOS keeps no memory of where your windows go in either one.

What closing the lid does to your desk

You are working at your desk with the MacBook open beside one or two monitors. You close the lid to free up space, and the windows that were on the laptop screen land on top of whatever you had on the externals. Later you open the lid for a call, and nothing moves back. The laptop screen sits empty, or worse, the menu bar has jumped onto it.

From macOS's side, closing the lid removes a display. Every window on it has to be rescued onto a screen that still exists, so macOS moves them to an external, often stacked in the middle. Opening the lid is the reverse: a display appears, the arrangement changes, and macOS has no record of which windows belonged on the laptop screen before. It is the same thing that happens when you unplug a monitor, just triggered by the hinge.

Lid shut and lid open are two different setups

This is the part that makes it confusing. You think of it as one desk. Your Mac sees two: one with the externals plus the built-in display, and one with the externals alone. Each has a different shape, often a different main display, and sometimes different scaled resolutions. A layout that makes sense in one cannot simply be poured into the other, which is why closing and opening the lid a few times a day leaves a bigger mess each time.

It gets worse if you also undock. A MacBook that moves between a desk with the lid shut, a desk with the lid open, and the laptop on its own is switching between three setups, and macOS forgets your windows on every switch.

Free fixes worth trying first

1. Make an external the main display. In System Settings > Displays, choose Arrange and drag the white menu bar strip onto the external monitor you use most. Then opening the lid adds the laptop screen as a second display instead of handing it the menu bar, the Dock and every new window.

2. Set the two Mission Control settings. In System Settings > Desktop & Dock > Mission Control, turn on "Displays have separate Spaces" and turn off "Automatically rearrange Spaces based on most recent use," then log out and back in. On a Mac we tested, this was the difference between windows never returning to a reconnected display and always returning. The tradeoffs are in the unplugging guide.

3. Pick one way of working and stick to it. If you mostly work with the lid shut, keep it shut at the desk and only open it when you leave. Fewer switches means fewer reshuffles. It is not a fix, but it is free.

4. Make sure lid-closed use is set up properly. If the Mac goes to sleep the moment you close the lid, or the externals flicker, it is missing one of the things clamshell mode needs, usually power or an external keyboard and mouse. Apple's requirements and the right order to connect things are in our multi-monitor guide.

None of these make macOS remember a layout for each setup. They reduce how often things move and where the menu bar ends up. If that is enough for you, you are done.

A separate memory for lid shut and lid open

The real fix is something that remembers where every window belongs in each setup, and puts it back whenever the setup changes. That is what Putback does, and the lid is just another change of setup to it.

It learns each setup on its own. Putback keeps a separate layout for every set of displays. Work for a while with the lid open and it learns that layout; close the lid and work with the externals alone and it learns that one too. Neither overwrites the other.

It puts windows back on every switch. When you close or open the lid, macOS reports a display change. Putback waits for it to settle (half a second by default, adjustable in Settings), works out which setup you are in now, and moves every window to where it was the last time you worked that way. Close the lid and your windows go where you had them the last time the lid was shut; open it and the laptop screen gets its windows back.

One shortcut for anything that slips through. Command-Shift-R (the default, and you can change it) restores the current setup any time.

Putback works on macOS 14 and later and has a free seven-day trial with no card. If your windows also scramble after the Mac sleeps, that has its own causes and fixes: why Mac windows move after sleep.

Questions, answered.

Why do my windows move when I close my MacBook's lid?

Closing the lid turns off the built-in display, and to macOS that is the same as unplugging a monitor. Any window that was on the laptop screen has to go somewhere, so macOS moves it onto an external display. Nothing is broken; the display it lived on is simply gone.

Why do windows move again when I open the lid?

Opening the lid adds the built-in display back, which changes the arrangement a second time. macOS does not remember which windows lived on the laptop screen before you closed it, so they stay on the externals, and if the built-in display is set as your main display, the menu bar, Dock and new windows can jump to it as well.

Is clamshell mode the same as the lid being closed?

Yes. Clamshell mode is the name for using a MacBook with its lid closed and only external displays on. It needs power and an external keyboard and pointing device; Apple's exact requirements are covered in our multi-monitor guide.

How do I stop the menu bar moving to the laptop screen when I open the lid?

Set an external display as the main display. In System Settings, go to Displays, choose Arrange, and drag the white menu bar strip onto the external monitor. The main display is the one that keeps the menu bar and where new windows open by default.

Does Putback keep separate layouts for lid open and lid closed?

Yes. Putback keeps a separate memory for every set of displays, and lid shut and lid open are different sets, so it learns each layout as you work in it. When you close or open the lid, it waits for the displays to settle and puts every window back where it was in that setup.

Lid open or shut, every window goes home

Putback remembers a layout for lid open and lid shut, and puts each one back.

Download free trial

Free for 7 days · then $19, once · macOS 14+