Clicking on Dock icon does not bring window on top (OS X Lion)

Solution 1:

This same problem happened to me. What I did was:

  1. Go in to the launchpad, there should be a folder called "Other"

  2. Click on Terminal, a window will pop up and will say

    Last login: Fri Apr 28 12:35:22 on ttys000
    Computer-Name:~ username$ 
    
  3. Type in

    Killall Dock
    

Now that should fix it.

Solution 2:

It could be your plist is corrupted. I believe the Spaces preferences are under com.apple.dock.plist. Back it up and delete it, then logoff. See if that helps.

edit:

  1. Click on your user account in Finder (the little house icon).
  2. Click Home/Library/Preferences.
  3. There should be a file named com.apple.dock.plist. Drag to your desktop.
  4. OSX should create a new plist file.
  5. Logoff just in case, since this seems to be a weird troubleshooting issue I've never seen before.
  6. If that didn't help, keep the old plist handy.

Solution 3:

Obviously Mountain Lion is not so clever with the use of multiple displays on a temporal basis: I got my mail main window back by plugging the external display back and deselecting the "mirror displays" check box from display properties! There it was all the time, the mail window, somewhere outside the reach of screen.

I had had the same problem with Mail. No matter what, I could't get the main mail window to open and show my mailboxes, even though the dock icon showed the number of new mails and task bar was showing for Mail. I could only open new message screen. I had then noticed I had similar problems with other applications as well (e.g. Microsoft Office).