Comment 4 for bug 843674

Stephen Boddy (stephen-j-boddy) wrote :

Some possible workaround thoughts:

    focus-out signal callback defers (idle_add) the call to hide.
    If one of our own windows/menus pops up, an inhibit flag is set.
    When the window/menu is closed the deferred hide on the main window is called
    In the deferred function, we check if we now have focus, and do not hide
    In the deferred function, we check if inhibit is set and do not hide
    Could create a popup_menu subclass that sets the inhibiter
    Could possibly use a decorator to set/clear the inhibit flag.

Or is there some way to detect when the application loses focus?