summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@redhat.com>2015-06-17 16:37:54 -0500
committerJonathon Jongsma <jjongsma@redhat.com>2015-06-19 14:39:48 -0500
commitc33f37efe334dde0554d0c33c33115a80d8b39d9 (patch)
tree7626fd6f3d21a1b19d56064859222205be290d2c
parent999bd6767576d4adacc7ecb3f89bcfeb9f39e74e (diff)
downloadvirt-viewer-c33f37efe334dde0554d0c33c33115a80d8b39d9.tar.gz
virt-viewer-c33f37efe334dde0554d0c33c33115a80d8b39d9.tar.xz
virt-viewer-c33f37efe334dde0554d0c33c33115a80d8b39d9.zip
Don't wait for reconnect when user cancels auth
When starting virt-viewer with the --reconnect switch to a guest that has a password, if the user cancels the authentication dialog (e.g. pressing 'Esc'), the window will display "Waiting for guest domain to restart". Obviously, the domain will never restart because it's already running. After this fix, the application will simply exit when the user cancels authentication, even if the --reconnect switch is used.
-rw-r--r--src/virt-viewer-app.c5
-rw-r--r--src/virt-viewer-app.h1
-rw-r--r--src/virt-viewer.c2
3 files changed, 7 insertions, 1 deletions
diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index 3f10546..d762699 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -2566,6 +2566,11 @@ virt_viewer_app_get_option_group(void)
return group;
}
+gboolean virt_viewer_app_get_session_cancelled(VirtViewerApp *self)
+{
+ return self->priv->cancelled;
+}
+
/*
* Local variables:
* c-indent-level: 4
diff --git a/src/virt-viewer-app.h b/src/virt-viewer-app.h
index f53fa73..bbbc9b4 100644
--- a/src/virt-viewer-app.h
+++ b/src/virt-viewer-app.h
@@ -102,6 +102,7 @@ gint virt_viewer_app_get_initial_monitor_for_display(VirtViewerApp* self, gint d
void virt_viewer_app_set_enable_accel(VirtViewerApp *app, gboolean enable);
void virt_viewer_app_show_preferences(VirtViewerApp *app, GtkWidget *parent);
void virt_viewer_app_set_menus_sensitive(VirtViewerApp *self, gboolean sensitive);
+gboolean virt_viewer_app_get_session_cancelled(VirtViewerApp *self);
G_END_DECLS
diff --git a/src/virt-viewer.c b/src/virt-viewer.c
index 9c3ccc9..637b9e4 100644
--- a/src/virt-viewer.c
+++ b/src/virt-viewer.c
@@ -161,7 +161,7 @@ virt_viewer_deactivated(VirtViewerApp *app, gboolean connect_error)
priv->dom = NULL;
}
- if (priv->reconnect) {
+ if (priv->reconnect && !virt_viewer_app_get_session_cancelled(app)) {
if (priv->domain_event < 0) {
g_debug("No domain events, falling back to polling");
virt_viewer_start_reconnect_poll(self);