Sub topic 1
Windows, apps and the desktop
Spaces, Mission Control and window tiling all act on windows, so you need a precise picture of what a window is first. This chapter covers how macOS separates apps from windows, what the desktop is, and which actions affect which. Later chapters build on these distinctions.
Prerequisites
This chapter assumes you can already do the following:
- Use the Dock, the menu bar and System Settings.
- Use a trackpad or mouse, and know the modifier keys: Control, Option, Command and Fn.
- Open a Terminal window and paste a command into it. This is needed for only one short example.
You do not need any knowledge of Spaces or Mission Control yet.
Apps and windows are different things
On macOS, an app is a running program. A window is one rectangle of content that the app draws. One app can own zero, one or many windows. The two have separate lifetimes, which is the main source of confusion for people coming from other systems.
- An app can be running with no windows. Safari with every window closed is still running.
- A window never exists without an app. When the app quits, all its windows go with it.
- The Dock shows a small dot under the icon of each running app. The dot does not tell you whether the app has any visible windows.
- Click a running app's Dock icon with no windows open and most apps create a new one. Some apps instead just become active.
Many Mac apps are document-based. Each document gets its own window, and the app is the shared machinery behind them. This is why one app can show up in several places at once. That matters later, because Spaces assign windows to desktops, and an app's windows can sit on different Spaces.
The active app and the menu bar
Exactly one app is active, also called frontmost, at a time. The menu bar at the top of the screen always belongs to that app. The app's name appears in bold next to the Apple menu. Click a window of another app and the whole menu bar changes.
This has a practical consequence. Most keyboard shortcuts go to the active app, and macOS handles a few system-wide ones itself. A shortcut that "does nothing" often went to a different app than you expected.
A window can also be in one of two states within the active app:
- The key window receives your keystrokes. Its title bar buttons are colored.
- Other windows of the same app are visible but not key. Their title bar buttons are gray.
What the window controls do
The three buttons at the top left of a standard window look similar but do very different things. Keyboard equivalents are usually faster.
| Action | Shortcut | What happens | App still running? |
|---|---|---|---|
| Close window | Command-W (red button) | The window is closed. The app may keep running. | Usually yes |
| Quit app | Command-Q | All of the app's windows close and the app exits. | No |
| Hide app | Command-H | All of the app's windows disappear but remain in memory. | Yes |
| Hide others | Option-Command-H | Every app except the active one is hidden. | Yes |
| Minimize window | Command-M (yellow button) | The window shrinks into the Dock. | Yes |
| Zoom or full screen | Green button | Depends on the macOS version. See below. | Yes |
Two details trip people up:
- Closing the last window of an app does not always quit it. Apps like Mail or Safari keep running. Some small utility apps quit when their last window closes, because their developers chose that behavior.
- Hiding differs from minimizing. A hidden app has no Dock thumbnails and comes back as a group when you click its icon or press Command-Tab. A minimized window sits in the right side of the Dock and comes back one window at a time.
The green button
The green button has changed over time. In older versions of macOS it enters full-screen mode when you click it. Holding Option while clicking it zooms the window to a larger size without entering full screen. Recent versions (macOS Sequoia 15 and later) show a menu when you hover over the button. The menu offers full screen, tiling options and window arrangements. Chapter 7 covers that menu in detail. For now, remember that the same button can lead to three outcomes: zoom, full screen, or tiling.
Switching between apps and windows
Because apps and windows are separate, macOS has separate shortcuts for switching between them:
- Command-Tab cycles through running apps, most recently used first. Release Command to switch.
- Command-` (the backtick key, above Tab on US keyboards) cycles through windows of the active app only.
- Control-Down Arrow, or a three- or four-finger swipe up depending on your trackpad settings, shows all windows. That is Mission Control, which has its own chapter.
A window you cannot find is often in one of four places:
- Minimized in the Dock.
- Hidden with Command-H.
- On another Space, which is the topic of the next chapter.
- Off-screen after a display was unplugged.
You can check the first two quickly. The Window menu in the menu bar lists the active app's windows, including minimized ones. Choose Bring All to Front to gather the app's windows.
What "the desktop" means
"Desktop" means three different things on a Mac, and tutorials often mix them up:
- The desktop folder is the folder at
~/Desktop. Files you drop on the desktop are stored there. This is a real folder in your home directory. - The desktop surface is the area behind your windows, drawn by Finder. It shows your wallpaper and, optionally, the items from the desktop folder.
- A desktop in the Mission Control sense is a Space: a full workspace with its own set of windows. Chapter 2 defines this precisely.
When a document says "show the desktop", it means moving windows aside to reveal the surface. You can do this by pressing F11 on some keyboards, by pressing Fn-F11 on others, or by using a trackpad spread gesture (thumb and three fingers apart). In recent macOS versions, you can also click the wallpaper. The "Click wallpaper to reveal desktop" option in System Settings, under Desktop & Dock, controls this. Its choices are Always or Only in Stage Manager.
Windows are not hidden or minimized when you reveal the desktop. They slide to the screen edges and come back when you click again or switch apps.
How the pieces fit together
The diagram shows the containment model this tutorial builds on. Apps own windows, and windows are placed on a desktop surface. Spaces, introduced next, let you have several such surfaces.
Reading the diagram: the app is the unit that runs, quits and hides. The window is the unit that you close, minimize, move and resize. The desktop is the background layer.
Inspecting running apps from the terminal
You can ask macOS which apps are running without opening Activity Monitor. This one-liner uses AppleScript through osascript to list the names of all regular (non-background) apps:
osascript -e 'tell application "System Events" to get name of every process whose background only is false'The output is a comma-separated list such as Finder, Safari, Terminal. The first time you run it, macOS may ask whether Terminal is allowed to control System Events. Approve that in the prompt, or under System Settings, Privacy & Security, Automation.
To count an app's windows you need Accessibility permission, which gives a script wide control over your Mac. This tutorial does not rely on it, so skip it unless you have a reason.
Common errors at this level
- Expecting Command-W to quit. It closes one window. Use Command-Q to quit.
- Expecting Command-Tab to switch windows. It switches apps. When you have two Safari windows, use Command-` to move between them.
- Losing a window to Hide. A hidden app is still running. Click its Dock icon or press Command-Tab to bring it back.
- Treating the desktop folder as a Space. Files on the desktop surface have no relation to which Space you are viewing. The same files appear on every Space.
- Assuming the green button always behaves the same. Its action depends on the macOS version, whether you hold Option, and whether you hover.
Why this matters for the rest of the tutorial
Each later feature acts on one layer of this model:
- Spaces and Mission Control group windows across several desktops.
- Full-screen mode and Split View turn a window into its own Space or pair two windows in one.
- Window tiling resizes windows and snaps them to screen regions.
- Stage Manager groups an app's windows and hides the rest.
- App-to-Space assignment operates on an app, but takes effect on that app's windows.
When something behaves unexpectedly later, ask first whether the feature acts on the app or on the window. That one question resolves most confusion.
Exercise
You close the only Safari window with Command-W. The Dock still shows a dot under the Safari icon. What does this tell you, and what is the quickest way to get a Safari window back? Then explain how Command-H differs from Command-M for the same app.
Show answer
The dot means Safari is still running with no windows, because closing a window does not quit the app. Click the Safari icon in the Dock, or press Command-N, to open a new window. Command-H hides the whole app and all its windows together, and clicking its Dock icon restores them as a group. Command-M minimizes one window into the right side of the Dock, and you restore it by clicking that window's thumbnail there.
Exercise
Command-Tab brings you to Terminal, but you want the second Terminal window that is behind the first. Which shortcut do you use, and why does Command-Tab not do this?
Show answer
Use Command- (backtick). Command-Tab cycles between apps, and Terminal is a single app no matter how many windows it owns. Command- cycles through the windows of the active app only.