41f889f app: simplify toggling visibility

Authored and Committed by elmarco 5 years ago
    app: simplify toggling visibility
    
    There is a hack to maintain the toggle state to a desired state within
    the "toggled" handler.
    
    However it is only necessary for the ask-quit case. In this case, we
    want to maintain the item active, which is simpler to handle than the
    general case. Simplify the code by folding
    virt_viewer_app_window_set_visible() and removing the static
    "reentering" hack, only maintaining "active" on the last item.
    
    Note that the hack was needed since there is no way to hook a signal
    handler on "clicked" before "toggled" is emitted and handled by Gtk,
    to avoid the recursion.
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Acked-by: Victor Toso <victortoso@redhat.com>
    
        
file modified
+11 -32
file modified
+1 -1