Why Mac windows open on the wrong desktop after a restart (and the fix)

macOS keeps your desktops through a restart, but it doesn't reliably remember which window was on which desktop. Apps reopen their windows themselves, and many of them land on whatever desktop is showing at the time, usually Desktop 1. Assigning apps to desktops in the Dock helps one app at a time. To put every window back where it was, you need a tool that records the layout before the restart, like Spacepal's saved window layouts.

Why does this happen?

Two different systems are involved:

So the desktops come back, but their contents get mixed up. The more desktops and windows you have, the more likely this is.

Which macOS settings help?

None of these saves and restores a full layout. macOS has no built-in "remember where every window was" feature.

How does Spacepal put windows back after a restart?

Spacepal can record which Space and which position every window is on, and move them back later:

  1. It saves automatically. With "Remember where every window is" on (Settings, Windows; on by default), Spacepal saves the layout every 5 minutes.
  2. It offers to restore after a restart. If Spacepal starts soon after your Mac boots, it asks "Put your windows back on their Spaces?" and, if you choose Restore, moves each window back to its Space and frame. Turn on Launch at login in Settings, General so this happens.
  3. You can save and restore by hand. Use the menu (Windows and Spaces) or the links spacepal://save-layout and spacepal://restore-layout (see URL scheme).

Windows are matched by app and window title, then by app alone. Restoring moves windows that are already open. It doesn't relaunch apps, so let macOS reopen them first, then restore.

Your Space names come back too, because Spacepal ties each name to the Space itself and not to its number.

What are the limits?

Can new windows always open on the right Space?

Yes. Give a Space "Apps that belong here" rules, for example Mail on a Space called Mail. New windows of that app are moved there as they open, after a restart or any other time. Each window is placed once, so you can still move it yourself.

Related guides

Summary

Written by Dan Bayer, developer of Spacepal. Last updated 2026-10-27.