How do I give focus to the correct window when closing another application's window?

On Lion, if I am in Chrome and click on an alert from Outlook that says I received an e-mail, I get a new window from Outlook with that e-mail on top of Chrome (I can still see Chrome immediately under my Outlook e-mail window). When I close the e-mail, I would expect the OS to re-focus on the Chrome window (since that's where I came from), but in fact it pulls the Outlook window out and gives it focus instead.

It appears that Lion tries to keep focus on a particular app rather than a particular window. Is there any way to change this behavior so that my interaction with the window "stack" makes sense?


This has been the behaviour in OS X's window system since at least the original OS X (10.0), and probably is consistent back to Classic Mac OS (if that's the case, it likely dates back to System 7 or System 6 with MultiFinder).

In any case, this is how it is: to my knowledge, there's no way to change it.

The best you can do is to not leave Outlook's window open all the time. The app won't quit when you close the main window like it does on Windows.


Would it work for you if the application that mouse pointer is on to have focus? If so, this thread would help:

Focus-follows-mouse

This might not be exactly what you were looking for, but I think it might solve the issue.