Archive for July, 2009

What Dropzone learned from Google Chrome

Tuesday, July 28th, 2009

chrome-dropzone

Have you tried the Google Chrome for Mac developer release? It’s missing just about every major feature you might expect in a browser (bookmarking, printing and Flash to name a few) but is still plenty awesome, and mostly on account of its incredible speed. It feels even snappier than Safari 4 which is also pretty quick.

As well as being fast at rendering pages, it also appears to start very quickly. When you first launch it, you’ll see what I mean. Many people have commented that the dock icon doesn’t even bounce once during launch. Here’s Kevin Rose and Leo Laporte discussing this unusual behavior on last weeks TWiT episode:

This behavior of zero dock icon bounces intrigued me as well, so I did some digging, and Kevin’s right, they did a hack. If we look in Chromes Info.plist we find the following:

Info.plist

The key I’ve highlighted tells OS X that Chrome is an agent application, that is, a background application that should not appear in the Dock or Force Quit window. That seems strange, as we know Chrome does appear in both.

Some more digging led me to this patch which tells us exactly what’s going on here.

chrome_browser_browser_main_mac.mm - Issue 27108_ Temporary fix for the Cocoa-in-renderer problem. - Code Review

So. Chrome is initially launched as a background app and then transformed into a foreground app using the Carbon API call TransformProcessType. This means that when Chrome starts, the dock icon doesn’t bounce because OS X doesn’t think it should have a dock icon. When TransformProcessType is called to give it back its dock icon Chrome is already fully loaded, the net result being that we never see the dock icon bounce.

What’s interesting is that the Chrome developers are actually doing this to workaround a completely unrelated issue involving the WebKit UI and it has even been filed as a bug. And to think we all thought they had done it deliberately to give the impression of a faster launch. Shame on us all.

Anyhow, I was interested in adding this behavior to Dropzone, as the Dropzone dock icon should ideally not bounce either as this is more in line with the behavior of the built in dock grids that Dropzone tries to mimic, also, the dock icon bounces would occasionally interfere with the positioning and display of the grid directly above it. Therefore, I have added this same code to Dropzone and made another improvement - if you click on the Dropzone dock icon when it’s closed, the grid is displayed immediately after launch. There is also another neat feature in Dropzone that you may not be aware of - if you drag something onto the dock icon when Dropzone is closed, it automatically launches and opens the grid. I have done a quick screencast that demos both of these behaviors:

As you can see, Dropzone launches so quickly you barely even notice that it was closed to begin with. Without this code, the Dropzone dock icon would always bounce once even though before it finished its first bounce, Dropzone was already launched.

So, while I’m certainly not recommending people start adding this code to their apps to provide the illusion of a faster launch, in the special case of Dropzone this is a nice touch.

It will also be interesting to see whether Google ends up sticking with this behavior in future releases of Chrome. I think since Chrome launches so quickly anyway they are best just to leave it as is. Also, I bet people will complain it now seems to start ’slower’ if they make it start bouncing again. Perception is everything.

Dropzone is Launched

Thursday, July 2nd, 2009

icon

I just released Dropzone over at Aptonic.

Go download it if you haven’t already, and if you like it, support the project by buying a copy - As promised, it’s only $10.

I’m really very proud of it, and have come to depend on it in my day to day work. Although it can take a while before it feels a natural part of your OS X workflow, once you ‘get it’ it becomes an indispensable utility, a lot like Quicksilver or TextExpander.

I see this as just a beginning, and I hope you’ll help me build on it using the Dropzone scripting API. Some pretty neat stuff has already been built. I also need your feedback on how to evolve the API to make it even more useful.

There are many more features I am working on for future releases, such as SFTP, WebDAV and MobileMe support. So if you need these, rest assured they are coming soon.

Meanwhile, I hope you enjoy using the app and let me know what you think of it!