As part of the "Back to the Mac" theme in OS X Lion (10.7) by Apple, they have taken what they have learnt from user interfaces and experience on iOS devices such as the iPhone and iPad, and tried to bring some of those concepts home to the full fledged Mac experience.
There are many changes in relation to this but one of those most noticeable, and sometimes annoying, features -- is that applications will now often restore the documents and windows you had open when you last closed them. Not only that, your entire desktop will re-open to every application and document you were last using.
While this is sometimes useful, it can also be very annoying. For myself, the most common application this bugs me with is Preview. I am quite used to building up a pile of documents in preview, only to quit it to clear them out so that next time I start them, the build-up is gone. This is also happening with Google Chrome and TextEdit.
Fortunately, there are some solutions at hand! There are two main options;
Close all windows in an application once-off
If you use the option key when selecting the application menu, you will note most applications gain a "and Close all windows" suffix on the quit item. This will quit the application and not remember the open windows.
Additionally you can simple use Apple-Option-Q as a single keyboard shortcut to close an application including all of it's windows.
Disable the feature entirely
You can wholesale disable the feature, so that no application will re-open windows and so that your desktop won't re-open applications. This is a fairly simple toggle.
- Select the Apple menu, then move halfway down to "System Preferences" and select it.
- Select the "Show All" button from the top menu bar
- Select the very first icon under the "Personal" category, "General"
- Look towards the bottom and select the option "Restore windows when quitting and re-opening apps"
Disable the behaviour on a per application basis.
It can be done manually with "defaults write" in many cases, however a free application RestoreMeNot has been developed and released which automates this behavior.
It's a free download and allows you to exclude specific applications from this behavior, in my case Preview was first cab off the rank.