Mac OS X: Self-resizing windows in Cocoa applications

Posted by Pierre Igot in: iTunes, Macintosh
August 11th, 2004 • 11:09 pm

One little thing that I really appreciate in Apple’s Cocoa applications, such as Safari, Mail and Preview, is what happens if you have two monitors and drag an open window from one monitor to the other.

In my situation, for example, the main monitor (a 23″ FP display) has a vertical resolution of 1200, whereas the secondary monitor (a 17″ FP display) only has a vertical resolution of 1024. Sometimes I have windows on the main monitor whose height exceeds 1024 pixels.

If I drag one of those windows to my secondary monitor in any of the afore-mentioned Cocoa applications, obviously the window is not going to fit, because its height exceeds the vertical resolution of the monitor.

So what does Mac OS X do? As soon as I drop the window somewhere in the secondary monitor’s viewing area, it automatically adjusts the height of the window so that it fits, i.e. so that both the window title bar at the top and the Resize box in the bottom-left corner are fully visible.

It’s quite convenient! And it’s one of these little touches that really make you fully appreciate Apple’s attention to details.

Unfortunately, this nifty feature appears to be limited to Apple’s Cocoa applications. If I make the main iTunes window taller than 1024 pixels and then drag it to my secondary monitor… nothing happens.

I just tried the same thing with other non-Apple Cocoa applications that I own, such as NetNewsWire and Spell Catcher X, and it works as well, so it appears to be something that’s built into all Cocoa applications by default. Cool.

Now we just need it to be built into all Carbon applications by default as well. Maybe one day our computing experience will be really fully consistent. Until then… the name of this blog is not changing!

4 Responses to “Mac OS X: Self-resizing windows in Cocoa applications”

  1. René Puls says:

    Interesting! I can’t test this myself because I have only one monitor, but what happens when you drag the window back to the larger screen? Is the window adjusted back to the size it had on the original screen? That would be really cool…

  2. Pierre Igot says:

    No, the window doesn’t “remember” the size it was on the original screen. It only self-adjusts when moving from a taller monitor to a shorter monitor. And it only does so on the vertical axis.

    When moving the window back to the original monitor, it just stays the same size.

  3. René Puls says:

    Thanks for clearing this up. I imagine that this could be a bit irritating sometimes, but then I’ve never really worked with more than one monitor…

  4. Pierre Igot says:

    The only irritating thing here is that not all applications have the same behaviour. Otherwise, I have no problems with the way the Cocoa application windows behave. There are just as many reasons not to readjust the height when moving the window back to the main screen as there are reasons to readjust it.

Leave a Reply

Comments are closed.