There's a problem in handling dock click in Mac since Cocoa version,
because function macEventFilter is designed for Carbon, not Cocoa.
Here is an issue:
http://code.google.com/p/psi-dev/issues/detail?id=403
Attached file is a patch for handling this one. I'm not good in git,
so i send it here.
This is an adoption of this solution:
https://github.com/KDAB/Charm/blob/master/Charm/MacApplication.mm
--
Best regards, Nikolay Mikheev