src: correctly set display state when cancelling quit request
When the last window is closed we optionally show a confirmation dialog
to check if user wants to quit. If the user cancels, we need to ensure
the display menu state gets set back to checked.
We called g_action_change_state correctly, but a later call to
g_simple_action_set_state used the "visible" variable which was not
correctly reset back to TRUE upon cancel.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Daniel P. Berrangé authored 2 years ago
Daniel P. Berrangé committed 2 years ago
2346 | 2346 | virt_viewer_window_hide(win); |
2347 | 2347 | } else { |
2348 | 2348 | virt_viewer_app_maybe_quit(self, win); |
2349 | if (!priv->quitting) | |
2349 | if (!priv->quitting) { | |
2350 | 2350 | /* the last item remains active, doesn't matter if we quit */ |
2351 | visible = TRUE; | |
2351 | 2352 | g_action_change_state(G_ACTION(act), |
2352 | g_variant_new_boolean(TRUE)); | |
2353 | g_variant_new_boolean(visible)); | |
2354 | } | |
2353 | 2355 | } |
2354 | 2356 | } |
2355 | 2357 |