GNOME Bugzilla – Bug 123816
Focus history not quite working
Last modified: 2004-12-22 21:47:04 UTC
As per https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=105982 open a terminal (or whatever), focus it, open a second terminal (or whatever), focus that, close the second one, the first one doesn't regain focus. But it should be the most recent in the MRU list. Oh wait - nevermind. The panel you used to launch the second one is the most recent in the MRU list; that's the problem I bet. So what we need to do is, when focusing the most recent window in the MRU list, skip panel/desktop (ctrl+alt+tab) windows on the first pass; and if there are no windows except the panels/desktops, pick the first of them. Or something like that. Basically just prefer non-panel/desktop windows for the next window to focus.
This is slightly more complicated. Imagine you open a dialog like the GNOME panel's properties dialog; on closing that, you want to revert to having the panel focused. So maybe the rule is that when a window of type NORMAL gets focus, we shuffle all the panels to the end of the MRU list? Or when a window not in the same group as a panel gets focus, we shuffle?
Fixed in CVS. I shuffle panels to the end of the MRU (with a stable sort) anytime a non-panel is focused.