summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@redhat.com>2013-11-08 14:53:28 -0600
committerJonathon Jongsma <jjongsma@redhat.com>2013-11-20 10:58:52 -0600
commitd9e14ff3754487959a4e051378c75be5b3db99f4 (patch)
treeefebf4298274cb683b2f4a149354690c79ed183f
parent764a5047265135233a9ae9ac8283db849723953e (diff)
downloadvirt-viewer-d9e14ff3754487959a4e051378c75be5b3db99f4.tar.gz
virt-viewer-d9e14ff3754487959a4e051378c75be5b3db99f4.tar.xz
virt-viewer-d9e14ff3754487959a4e051378c75be5b3db99f4.zip
Ensure auto-conf is only done once
Auto-conf should only happen at startup. It is triggered from several places due to the somewhat unreliable ordering of events, but that doesn't mean we want to run it several times. This patch ensures that we only do it once.
-rw-r--r--src/virt-viewer-session-spice.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
index 4b90afe..85d3895 100644
--- a/src/virt-viewer-session-spice.c
+++ b/src/virt-viewer-session-spice.c
@@ -55,6 +55,7 @@ struct _VirtViewerSessionSpicePrivate {
int usbredir_channel_count;
gboolean has_sw_smartcard_reader;
guint pass_try;
+ gboolean did_auto_conf;
};
#define VIRT_VIEWER_SESSION_SPICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), VIRT_VIEWER_TYPE_SESSION_SPICE, VirtViewerSessionSpicePrivate))
@@ -726,6 +727,13 @@ virt_viewer_session_spice_fullscreen_auto_conf(VirtViewerSessionSpice *self)
gint i;
gsize ndisplays = 0;
+ /* only do auto-conf once at startup. Avoid repeating auto-conf later due to
+ * agent disconnection/re-connection, etc */
+ if (self->priv->did_auto_conf) {
+ DEBUG_LOG("Already did auto-conf, skipping");
+ return FALSE;
+ }
+
app = virt_viewer_session_get_app(VIRT_VIEWER_SESSION(self));
g_return_val_if_fail(VIRT_VIEWER_IS_APP(app), TRUE);
@@ -764,6 +772,7 @@ virt_viewer_session_spice_fullscreen_auto_conf(VirtViewerSessionSpice *self)
}
spice_main_send_monitor_config(cmain);
+ self->priv->did_auto_conf = TRUE;
return TRUE;
}