Comment 12 for bug 843674

Hehe. Yeah, that makes a lot more sense now. Sorry I didn't spot the mistake myself. I can't remember every line of code, and due to only glancing at it instead of trying to merge it, I missed the obvious.

Anyhoo. I've tried it, and it does indeed work (yay!) I've modified it a little. The flags on each terminal, and subsequent scanning of them were unnecessary. Instead the flag is on the window, and in the terminals it does get_toplevel (which gives the window object) and sets the flag directly. Just feels a bit more "correct" to me.

On top of that I have put in a fix for the group menu and Preferences window. These no longer cause the window to hide. I haven't yet decided about the behaviour when Preferences are open. At the moment it is possible to get the main window to hide while Preferences is open. Perhaps a semi-permanent block should be implemented until the Preferences window is closed.

Moving and resizing the window with the mouse no longer cause an issue. This might be because I'm in Unity rather than Classic gnome on this machine. Using Alt to move or resize still causes loss of focus and hidden window. I think Unity is grabbing this for the HUD, causing it.

The issues in comment #2 and #5 still apply. I'm not sure if these can be fully resolved.