[virt-tools-list] [PATCH virt-viewer 12/25] Prevent from adding the same display several time in the session

Marc-André Lureau marcandre.lureau at gmail.com
Tue Jul 17 19:24:54 UTC 2012


In virt_viewer_session_spice_display_monitors(), we (re)add the
display unconditionnaly every time we receive a new MonitorConfig.
---
 src/virt-viewer-session.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/virt-viewer-session.c b/src/virt-viewer-session.c
index 18b6922..9249a1f 100644
--- a/src/virt-viewer-session.c
+++ b/src/virt-viewer-session.c
@@ -282,6 +282,9 @@ virt_viewer_session_new(void)
 void virt_viewer_session_add_display(VirtViewerSession *session,
                                      VirtViewerDisplay *display)
 {
+    if (g_list_find(session->priv->displays, display))
+        return;
+
     session->priv->displays = g_list_append(session->priv->displays, display);
     g_object_ref(display);
     g_signal_emit_by_name(session, "session-display-added", display);
-- 
1.7.10.4




More information about the virt-tools-list mailing list