Controlling inactive windows
Here’s a tip about another neat OS X feature that I’ve really grown to like, and a plead to other developers (like those working on Carbon/iTunes/Finder at Apple) to support it fully. It’s about dealing with unfocused windows.
The case that most people probably know is closing an unfocused window by clicking its close button. By closing a window, the application to which the window belongs, is not made active. This is good because we’re removing clutter, and after having removed it, there’s no logical choice for a new candidate to receive focus (so let’s not take away focus from what the user did).
In TextMate I replicated this behavior for tabs, as can be seen below. The case where the application is inactive is probably rare, but it works very well for when the window is just not the active one. Something I really wish OmniWeb had, for when links open in new windows, and I want to close the tab in the (now) inactive source window (yes, I did file a request).
Besides closing windows (which doesn’t have focus) it turns out that you can move them around, make selections, use all their controls, a.s.o.
The trick is to hold down the ⌘ modifier key while using the mouse.
I use it a lot when I have a window behind my active window, which has data I need to read, but is only partially visible. Holding down ⌘ while using the normal window movement gesture (click and hold the button on the title bar) allows you to drag around the window, without bringing it to front, or activate it.
Be aware though that holding down ⌘ and clicking the proxy icon (in the title bar) will show a menu with the parent folders of the document for which the icon is a proxy (another nice Mac OS feature).
As for using the controls in an inactive window, there are at least two scenarios where I find this useful.
- When working in the active window, but needing to view data in the inactive window, I have shown an example of this above, where I move, size and scroll in TextMate’s HTML preview while the main window is kept active, so it doesn’t mess up the window ordering.
- When a dialog with Okay/Cancel or similar is not active, clicking either choice will close it, so since I’m not interested in having its application become active and brought to front, I use ⌘ with the click.