Sub topic 2
What a Space is
A Space is macOS's name for a virtual desktop. Each Space holds its own set of windows, and you see one Space per display at a time. This chapter builds the working model that the rest of the tutorial relies on: what a Space contains, what it shares with other Spaces, and which kinds of Space exist.
This chapter assumes you can use windows, the Dock and the menu bar, and that you can open System Settings. It also assumes you are comfortable with a trackpad or mouse and modifier keys such as Control, Option, Command and Fn. It does not teach gestures or shortcuts. Later chapters cover those.
The core idea: a Space is a container for windows
A Space is not a folder, a user account or a separate session. It is a grouping that tells the window server which windows to draw right now. All the apps keep running whichever Space you are looking at. Switching Spaces changes which windows are visible. It does not suspend anything.
Three rules describe the model:
- Every window belongs to exactly one Space. The exception is a window assigned to all Spaces, covered in a later chapter.
- One app can have windows in several Spaces. The app is not tied to a Space. Its windows are.
- At any moment each display shows exactly one Space.
The second rule surprises many people. If you have two browser windows, one can sit in Desktop 1 and the other in Desktop 3. The browser is one running process, and its windows are spread across Spaces.
What a Space shares and what it owns
Spaces are less isolated than separate computers would be. Knowing which things are shared prevents most confusion.
| Item | Shared across Spaces or per Space |
|---|---|
| Running apps and their processes | Shared |
| Menu bar and Dock | Shared (the menu bar can hide in full-screen Spaces) |
| Open windows | Per Space (each window lives in one Space) |
| Desktop wallpaper | Per Space (you can set a different picture for each) |
| Desktop icons and Stacks | Shared (they show on every desktop Space) |
| Window positions and sizes | Per window, so they differ between Spaces |
| Files, clipboard, login session | Shared |
The Dock shows the apps that are running, not the apps in the current Space. A running-app dot under an icon tells you the app is open somewhere, not that it has a window here. Clicking that icon may jump you to another Space, depending on a setting described below.
The kinds of Space
macOS creates Spaces in three ways, and each behaves a little differently.
Desktop Spaces
A desktop Space is an ordinary desktop. It is the kind you create yourself in Mission Control. They are named "Desktop 1", "Desktop 2" and so on, numbered by position from the left. You can create up to 16 Spaces on each display. Every Mac starts with one.
Desktop Spaces are the only kind you can add windows to freely. You can drag any window into one, and any app can open new windows in it.
Full-screen Spaces
When you click the green button on a window and choose to enter full screen, the window does not simply grow. macOS creates a new Space just for it. The window fills the display and the menu bar hides until you move the pointer to the top edge.
A full-screen Space is named after its app. It sits to the right of all desktop Spaces in the order. When you leave full screen, the Space disappears.
Split View Spaces
Split View puts two apps side by side in one full-screen Space. The Space is created when you pair two windows, and it goes away when you end the pairing. A later chapter covers how to create and adjust it. For this chapter, what matters is that a Split View Space is one Space that holds two windows, and it counts as a single entry in the Space order.
| Kind | Created by | Removed by | Holds |
|---|---|---|---|
| Desktop | You, in Mission Control | You, or by closing it in Mission Control | Any number of windows |
| Full-screen | Entering full screen on a window | Leaving full screen or closing the window | One app window |
| Split View | Pairing two windows in full screen | Leaving full screen in either window | Two app windows |
When you remove a desktop Space that still has windows, those windows are not closed. They move to the neighboring desktop Space. You lose the grouping, not the work.
How Spaces are ordered
Spaces form a single row for each display, from left to right. Desktop Spaces come first. Full-screen and Split View Spaces follow in the order you created them. Switching "to the right" means moving along this row, and the left and right switching gestures work in the same order.
macOS can rearrange this row automatically. The setting "Automatically rearrange Spaces based on most recent use" moves the Space you used last toward the front. This is on by default, and many people find it disorienting because "Desktop 2" is no longer second. You can check whether the setting has been overridden in Terminal:
defaults read com.apple.dock mru-spacesIf the command prints 1 or 0, the setting was changed from its default. If it prints an error saying the key does not exist, you are on the system default, which is automatic rearranging. Changing the setting comes up later in the tutorial. This chapter only needs you to know that Space order is not always stable.
How switching and focus interact
Because an app's windows can live in several Spaces, macOS has to decide what happens when you switch to an app that has no window in the current Space. System Settings has an option for this: "When switching to an application, switch to a Space with open windows for the application". You find it under Desktop & Dock, in the Mission Control section.
- With the option on, picking the app from the Dock or with Command-Tab takes you to a Space where that app has a window.
- With the option off, the app becomes active in the current Space. Its menu bar appears, but it has no visible window until you open one or make a new one.
If you have ever clicked a Dock icon and been thrown across the screen to another Space, this option is the reason.
Spaces persist, but not forever in every detail
Spaces survive closing windows. An empty desktop Space stays until you remove it. Across restarts, macOS restores your Spaces, and apps that reopen their windows generally return them to the Spaces they were in. This restoring is not guaranteed. An app that opens windows from scratch can put them in the current Space. Windows of some apps can also land in a different Space after a display is disconnected, because the Spaces tied to that display have to go somewhere. That case belongs to the multiple-displays chapter.
Common misconceptions
- "A Space is a separate user session." It is not. All apps, files and the clipboard are shared. Only window visibility changes.
- "Closing a Space closes its apps." Removing a desktop Space moves its windows to a neighbor. Nothing quits.
- "Each app lives in one Space." Only windows have a Space. An app has no home Space unless you configure one, which comes up in the next chapters.
- "Full screen is just a big window." Full screen creates a separate Space with its own position in the row, which is why it can appear in Mission Control as its own thumbnail.
- "Space numbers are fixed." "Desktop 2" is a position, not an identity. If the order changes, the name moves with the position.
Putting it together
The model has four parts. A display shows one Space at a time. A Space is a set of windows. A window belongs to one Space. An app is a process whose windows can be anywhere. Desktop Spaces are the ones you manage, while full-screen and Split View Spaces appear and disappear as side effects of how you use windows. The next chapters build on this. Mission Control shows the row of Spaces and lets you rearrange them, and the chapters after it cover creating, switching and removing Spaces and assigning apps to them.
Exercise
You have a browser with two windows. One is in Desktop 1 and one is in Desktop 3. You enter full screen on the Desktop 1 window. Which Spaces exist for the browser afterward, and where does the Desktop 3 window live?
Show answer
The Desktop 3 window stays in Desktop 3, because a window's Space does not change when another window of the same app changes. The Desktop 1 window moves into a new full-screen Space, which is placed to the right of all desktop Spaces. The browser then has windows in two Spaces: Desktop 3 and its own full-screen Space.
Exercise
You delete the empty-looking "Desktop 2" in Mission Control, but a Notes window was open there. Is the Notes window closed? Where is it now?
Show answer
No. Removing a desktop Space does not close its windows. The Notes window moves to the neighboring desktop Space, and Notes keeps running.
Exercise
You run defaults read com.apple.dock mru-spaces and Terminal prints an error that the key does not exist. What does this tell you about your Space ordering?
Show answer
The setting was never changed from its default, so macOS is using the default behavior. By default it rearranges Spaces based on most recent use, so Space positions can change without your input.