The Weekly Review

Make It A Habit

Getting to Know OS X Window Behavior

Ever wonder why some windows in OS X act one way and others act another? When you close the Mail.app window, the window closes but the application is still running. But when you do the same with the Dictionary application, the window closes AND the application quits.

If you are a long time Mac user, perhaps you know why different apps act differently. In that case, this article is not intended for you.

For me, ever since switching from Windows, I’ve simply gotten used to the differences in the apps I use. But I have always been curious why there isn’t a universal behavior. And so I finally got around to taking a look through the Apple Human Interface Guidelines to find out why (also available in PDF). In the event there are others wondering the same, I thought I would share what I found.

Types of Windows

On page 193 of the HIG, the different types of windows are broken down. The following table shows the 4 types with a description of each.

Type Description
Document These windows contain file-based user data. They present a view into the content that people create and store. If the document is larger than the window, the window shows a portion of the document’s contents and provides users with the ability to scroll to other areas.
Application The main windows of applications that are not document-based. These windows use the standard Aqua window look and features; if the application is running in versions of Mac OS X prior to v10.5 (Leopard), these windows can use the optional brushed metal look.
Panels These windows float above other windows and provide tools or controls that users can work with while documents are open. In some cases, panels can be transparent. In end-user documentation, panels should be called windows.
Dialogs and Alerts These windows require a response from the user.

These descriptions are pretty straightforward. Using Mail.app as an example, we can see that it has examples of each of these types of windows.

The main Mail window is an application window:

A separate email message would be a document window:

The fonts window would be an example of a panel. Even though the email message window has the focus (as indicated by the cursor), the Fonts window stays overlaid on top:

And finally, the window below, accessed in Mail’s preferences, is an example of an alert/dialogue window. It requires a response from the user:

So those are the different types of windows found throughout OS X, Apple applications and other 3rd party apps. But that doesn’t exactly explain why some apps will quit when receiving the Close Window command.

Closing Windows

The answer is found on page 224 of the HIG. Under the section titled Closing Windows, there is a list of the three different ways users can close a window:

  • Choosing Close from the File menu
  • Pressing Command+W
  • Clicking the close button

Afterwards, the following paragraphs gives the answer to quench my curiosity.

In most cases, applications that are not document-based should quit when the main window is closed. For Example, System Preferences quits if the user closes the window. If an application continues to perform some function when the main window is closed, however, it may be appropriate to leave it running when the main window is closed. For example, iTunes continues to play when the user closes the main window.

There you have it. From this explanation, we can see why apps like Dictionary and Calculator shut down completely when the window is closed. Additionally, apps like Pages or iCal would continue to run after the window is closed.

But I think the wording here leaves a little room for ambiguity that leads to confusion in some cases:

If an application continues to perform some function when the main window is closed, however, it may be appropriate to leave it running when the main window is closed. [emphasis mine]

One example I can think of would be with some of OS X’s utilities. Network Utility quits when the window is closed, but Activity Monitor does not. These are two fairly similar applications and my initial expectation was that they would act the same—both are application type windows and do not give the user access to file-based data.

If the engineers at Apple do not exactly agree on when each type of behavior applies, I imagine 3rd party developers struggle with the guidelines in cases such as this.


So after looking at the documentation, I think the usage in a lot of current implementations, like iTunes, makes sense. In other cases, not so.

Now I have a better understanding of the behaviors of some of the applications, but more consistency would be nice. I guess the HIG is aptly named—these are only guidelines. Not all developers follow them in the same fashion.

Not even within the Mother Ship.