I've had this happen to me a few times in Tiger. Like you, I usually finally get around it by clicking on Finder's dock icon, but the last time it happened I managed to get out of this mode by tapping the command key.

I'm waiting for it to happen again so I can confirm, but it seemed to be behaving as if the system missed the last keyUp event for the command key.

Hrmm... no. I can't reproduce your symptoms. With Safari in front, a command-click on the desktop still brings Finder to the front in Tiger, but does nothing (not even deactivating the Safari window) in Snow Leopard, except that it will toggle the selected state of any desktop icon I hit.

I should mention that failure to register a keyUp is a recurring problem on both of my computers (G4 on Tiger, iMac on Snow Leopard), one that usually has disastrous results. For example, typing the delete key to remove one track from an iTunes playlist once ended up not only removing all tracks but then went on to delete all my playlists! There's no undo for that

I suspect USB flakiness, rather than software. It happens often enough (about weekly) to be really annoying, but not often enough to trouble shoot. I think it's probably related to the problem where the mouse just suddenly shoots off into a corner of the screen.

(Before anyone asks: BlueTooth is turned off. There are no wireless input devices anywhere around, except for the IR remote on the iMac, which I rarely use. No trackpads to register phantom gestures.)