mirror of
https://gitlab.com/virt-viewer/virt-viewer.git
synced 2025-02-04 17:47:05 +03:00
virt_viewer_app_quit: Cleanly close the connection before quiting
Even though the previous patches in this series ensure that the session gets properly finalized, we still need to wait for the disconnect signal, as spice-glib uses co-routines which need some time to cleanly close the connection / session. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
93eae5c49d
commit
8ec03e5097
@ -117,6 +117,7 @@ struct _VirtViewerAppPrivate {
|
||||
gboolean started;
|
||||
gboolean fullscreen;
|
||||
gboolean attach;
|
||||
gboolean quiting;
|
||||
|
||||
VirtViewerSession *session;
|
||||
gboolean active;
|
||||
@ -209,8 +210,14 @@ virt_viewer_app_quit(VirtViewerApp *self)
|
||||
g_return_if_fail(VIRT_VIEWER_IS_APP(self));
|
||||
VirtViewerAppPrivate *priv = self->priv;
|
||||
|
||||
if (priv->session)
|
||||
if (priv->session) {
|
||||
virt_viewer_session_close(VIRT_VIEWER_SESSION(priv->session));
|
||||
if (priv->connected) {
|
||||
priv->quiting = TRUE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
gtk_main_quit();
|
||||
}
|
||||
|
||||
@ -1055,6 +1062,9 @@ virt_viewer_app_disconnected(VirtViewerSession *session G_GNUC_UNUSED,
|
||||
{
|
||||
VirtViewerAppPrivate *priv = self->priv;
|
||||
|
||||
if (priv->quiting)
|
||||
gtk_main_quit();
|
||||
|
||||
if (!priv->connected && !priv->cancelled) {
|
||||
virt_viewer_app_simple_message_dialog(self,
|
||||
_("Unable to connect to the graphic server %s"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user