Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm a Linux/Windows/Mac user. I like all systems, *nixes more than Windows, but I like all nonethless.

I started using a Mac this year, and a difference between Linux and Windows that I can't understand is: why applications never get closes when I hit the "x" button, since this is the way Linux and Windows behave? I need to hit cmd+q or quit by the up menu.

I mean, is that only to be different from all of them, or there's a reason for this behavior? I can't see any advantage. If I want to close, I want to close. Period.

Anyone knows the reason for that?

share|improve this question
    
It's just that the default behavior of the X button is to hide. I agree that it's stupid, but it's a result of the "Your macbook knows better than you" mentality. Some windows and linux programs do the same thing, but in general, X means close. –  Falmarri Dec 7 '10 at 18:54
    
Sometimes a default behavior has a reason, even historical that doesnt makes sense. I would like to know it. –  Somebody still uses you MS-DOS Dec 7 '10 at 19:03
1  
I think historically it closes the window, but it doesn't quit the application. I don't know for sure why but I suspect it's rooted in the time before Macs had virtual memory and real application switching, you could close windows, possibly free some memory but not make opening a new one slow(er). –  Neth Dec 7 '10 at 21:58
18  
When an application always has only a single (main) window (e.g. System Preferences), closing it (either File > Close, Command+W, or the per-window red X in the upper-left) quits the application (being “done with” the window means you are “done with” the application since there is only one window). Applications that can have more than one main window do not quit when the last window is closed. The application stays open so you can use (e.g.) File > New… (or File > Open…) to open a new window without having to quit and restart the application. –  Chris Johnsen Dec 8 '10 at 2:33
1  
@Chris yours should be an answer, it makes the most sense to me –  phunehehe Dec 8 '10 at 16:01
add comment

6 Answers 6

up vote 40 down vote accepted

In some sense, it is a UI convention with history that goes back all the way to 1984. Since Windows and X11 both post date the original Mac GUI, one might say that Windows does it the Windows way "just to be different" rather than suggesting that the Mac is the oddball.

Back in the earliest days of the Macintosh, you could only run one application at a time. It was perfectly reasonable for an application to open with no windows because the application always had a visible menu bar at the top of the screen. When you closed all the windows of an application, it made sense to keep the application open because you could always use the menu bar to create a new document, or open an existing one. Exiting the process just because a window was closed didn't make any sense at the time, because there would have been no other process to yield focus to.

A few years on, the Macintosh of the late 80's advanced to the point where there was enough memory to have multiple applications open at once. Since the tools for doing this had to retain backwards compatibility with existing applications, they naturally weren't going to change the basic UI conventions and go killing applications without any windows open. The result was a clean distinction in the UI between a visual GUI element (a window), and an abstract running process (the application).

Meanwhile, Microsoft had been developing Windows. By the early 90's, Microsoft had Windows 3.X working well, and Motif on X11 had been heavily inspired by Microsoft's work. While the Macintosh was built around presenting a UI of Applications, Windows (as the name would suggest) was built around the philosophy that the Window itself should be the fundamental unit of the UI, with the only concept of an application being in the form of MDI style container windows. X11 also considered an application largely unimportant from a UI standpoint. A single process could even open up windows on multiple displays connected to several machines across a (very new-fangled) local area network.

The trouble with the Windows style approach was that you couldn't do some forms of user interaction, such as opening with just a menu bar, and the user had no real guarantee that a process had actually exited when the windows were gone. A Macintosh user could easily switch to an application that was running without windows to quit it, or to use it, but Windows provided absolutely no way for the user to interact with such a process. (Except to notice it in the task manager, and kill it.) Also, a user couldn't choose to leave a process running so that they could get back to it without relaunching it, except to keep some visible UI from the process cluttering up the screen, and consuming (at the time, very limited) resources. While the Macintosh had an "Applications" menu for switching, Windows popularised a "task bar," which displayed all top level windows without any regard for the process that had opened them. For heavy multitaskers, the "task bar soup" proved unweildy. For more basic users, the upredictability about what exactly qualified as a "top level window" was sometimes confusing as there was no learnable rule about exactly which windows would actually show up on the bar.

By the late 90's, Microsoft's GUI was the most commonly used. Most users has a Windows PC rather than a Macintosh or a UNIX X11 workstation. Consequently, as Linux grew in popularity over time, many developers were coming from a background of using Windows UI conventions rather than UNIX UI conventions. That combined with the history of early work on things like Motif drawing from Windows UI conventions, to result in modern Linux desktop environments behaving much more like Windows than classic X11 things like twm or the Macintosh.

At this point, "classic" Mac OS had run its course with Mac OS 9, and the Macintosh became a Unix powered machine with very different guts in the form of Mac OS X. Thus, it inherited the NeXT UI concept of a Dock. On the original NeXT machines, X11 was used, but with a fairly unique set of widgets and UI conventions. Probably the most distinctive of them was the Dock, which was a sort of combination program launcher and task switcher. (The "multicolumn" open file dialog box that is known in OS-X also came from NeXT, as well as some other visible things. The most significant changes in the OS-X transition were all the invisible ones, though.) The Dock worked well with the Macintosh's concept of "Application as the fundamental UI element." So, a user could see that an application is open by a mark on the dock icon, and switch to it or launch it by clicking on it. Since modern OS-X now supported multitasking so much better than the classic Mac OS had, it suddenly made sense that a user might want to have all sorts of things running in the background, such as some video conversion software that cranks away in the background, a screen recorder, VOIP software, Internet Radio, a web server, something that speaks in response to a spoken command, etc. None of that stuff necessarily requires a visible window to be open to still have a sensible user experience, and the menu bar was still separate from the windows at the top of the screen, and you could have a menu directly on the dock icon, so a user could always interact with a program that had no open UI. consequently, ditching the existing convention of keeping an application open, just to be more like Windows, would have been seen by most Mac users as a horrible step in the wrong direction. It makes several modes of interaction impossible, with no real benefit.

Obviously, some users prefer the Windows convention, and neither is "provably correct." But, migrating away from something useful like that, without any good reason would just make no sense. Hopefully, this tour through some of the history gives you a bit of context that you find useful.

share|improve this answer
add comment

The window is not the application in MacOS, in MacOS the windows connects to the application. That is why the application don't exit when you close a window.

On Windows the window is the application, that is why the the application should exit when you hit the exit button.

On Linux the developer decide what architecture he like to use, both ways is possible...

share|improve this answer
    
On Windows both ways are possible, too... –  Chris Down Jan 30 '12 at 14:24
    
And if you're using Cocoa to build apps, you can choose whether your app quits when the last window is closed. –  Blacklight Shining Oct 7 '12 at 10:48
    
In addition, System Preferences quits when its window is closed. (There may be other bundled apps that do this, but that's the only one I can think of at the moment.) –  Blacklight Shining Oct 7 '12 at 10:57
add comment

This is application specific. For example the System Preferences application does quit when you click on the red button. However, the majority of programs only close the window (an the documents within) when you try to "close" it. I guess the idea behind this is to make things faster when you want to use the application again.

If I want to close, I want to close. Period.

I agree, so I use keyboard shortcuts, Cmd+w for closing the window, and Cmd+q for really quitting. Most applications have this implemented. An alternative is to right click on the application icon and choose "Quit", which is much slower.

share|improve this answer
add comment

Yes, this is very, very annoying.

Meanwhile, this app should help:
http://www.carsten-mielke.com/redquits.html

From the description:

Have you ever tried to close an application with its red button and wondered why it is still open? RedQuits changes this. All programs now quit and close all open windows if you click the red button.

share|improve this answer
    
Interesting solution. –  Somebody still uses you MS-DOS Oct 4 '11 at 19:02
add comment

The reason for this is due to what is a window. In Microsoft Windows each application gets its own window where in Mac OSX and previous releases of Mac OS each file or document has its own window. When you "close Safari" you aren't closing [exiting] the application Safari but merely closing the file (http://unix.stackexchange.com). Likewise if you close the window of Pages (Apple's word processing application) you are closing the document that you were working on but the application Pages is still running. If you want to quit the application then use CMD+Q. Some non-file-creation applications follow this pattern as they can have multiple windows open or none at all and still function (iTunes).

Alternative steps: Press CMD+Q to quit the application instead of close the window [CMD+W] Secondary click on the icon on the dock (CTRL+Click or right mouse button or two finger tap on trackpad/magic mouse) and choose to quit that way.

Sadly this is just one little thing that one needs to do to unlearn Windows and think Mac :D

share|improve this answer
    
I got it after a few months. :) Actually, both approaches make sense. –  Somebody still uses you MS-DOS Nov 7 '12 at 23:12
add comment

At the beginning I thought that's also bad idea, but truly - now I think that's awesome. Actually I do not like that stupid behaviour that "X" terminates the app. It's very important to note that's much better approach for documents based apps, such as Photoshop or docs Editors, in fact - now I always forget to remember that "X" terminates the app (such as Photoshop), and then I need to spend additional time on initialisation. The application is simply there waiting for your new docs, why should I terminate it? Ok - that's a memory hog, but nowadays RAM is so cheap that it does not matter at all.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.