[Spice-devel] [PATCH spice-gtk 04/25] widget: add main channel before other channels

Marc-André Lureau marcandre.lureau at gmail.com
Thu Jul 12 15:29:01 PDT 2012


Make sure that the d->main channel member can be referenced when
adding further channels, when we perform their setup.
---
 gtk/spice-widget.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index 237d832..4d0f9be 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -441,7 +441,14 @@ spice_display_constructor(GType                  gtype,
                      G_CALLBACK(channel_destroy), display);
     list = spice_session_get_channels(d->session);
     for (it = g_list_first(list); it != NULL; it = g_list_next(it)) {
-        channel_new(d->session, it->data, (gpointer*)display);
+        if (SPICE_IS_MAIN_CHANNEL(it->data)) {
+            channel_new(d->session, it->data, (gpointer*)display);
+            break;
+        }
+    }
+    for (it = g_list_first(list); it != NULL; it = g_list_next(it)) {
+        if (!SPICE_IS_MAIN_CHANNEL(it->data))
+            channel_new(d->session, it->data, (gpointer*)display);
     }
     g_list_free(list);
 
-- 
1.7.10.4



More information about the Spice-devel mailing list