Do you mean that the main application window won't appear or it won't switch to that app?
For example, if you have iChat running and your buddy list is minimized and you click on iChat in the dock--the buddy list will "un-minimize" and come to the forefront. However, if you have the buddy list minimized and another window open in iChat like a chat with someone, it will not "un-minimize" the buddy list and will show that other window which is open.
When you click on the application in the dock, look in the upper left hand corner to the immediate right of the Apple logo. You should see the name of the application, which means you have switched to that application. If you don't, something's wrong. If you do, it's behaving "normally," which I have said and agree with you is not always consistent.
I previously implied that I would provide "exact steps to reproduce."
Since that time the only situations that I have found which can be reproduced relate to two specific applications:
1. Firefox. This issue seems to be based on the "feature" that when you click on a program with a running instance, the window for that instance appears. I would consider this "feature" normally to be the desired behavior. And if you want another instance, typically the CMD-N keystroke is used.
However, with Firefox, it seems that frequently I have no "browser" windows open, but the "download history" window is open. So clicking the Dock icon, brings that window to the foreground. However, I am trying to "start a browser window" and it appears to be not working.
So the workaround in this case is to recognize the download history window as "Firefox", and then use CMD-N to get the browser.
2. VMWare: this application sometimes does "nothing" when I am trying to bring back an instance of a running VM. I am not sure of the exact sequence yet, but when "nothing happens", the workaround is to go through the VMWare menu to invoke the Virtual Machine Library window, and select the VM from there.
The thing that I am getting used to is that the keystroke sequence Shift-CMD-L will not work whenever VMWare is the active application, because VMWare does not have the focus when you are within the VM, even though VMWare is the displayed menu at the top of the screen. Rather the Windows application within the VM has the focus, and Shift-CMD-L has no meaning in that context.
To further explain the above distinction, the following exercises will demonstrate it using VMWare:
- make sure that an application inside the VM has the focus; note that the main system menu indicates VMWare; press Shift-CMD-L; nothing happens (assuming that Shift-CMD-L is not interpreted by the application inside the VM).
- click on the top of the window in the title area. While the main system menu does not change, but remains VMWare, VMWare does now have the focus, and Shift-CMD-L is acted upon to bring up the Virtual Machine Library.
As you might imagine, before understanding this subtlety, it was very annoying to not be able to get Shift-CMD-L to do anything, even though it "seemed" VMWare had the focus.