diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2012-06-20 14:13:01 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2012-07-16 17:46:40 +0200 |
commit | ac9e55b64ff00803530557d2cad15287076a51b1 (patch) | |
tree | c7bf45c7514e0a8894a2ecd6008b14b45d2be686 | |
parent | 53127e30561ed4d66c772a57428b352a3b92127b (diff) |
widget: add main channel before other channels
Make sure that the d->main channel member can be referenced when
adding further channels, when we perform their setup.
-rw-r--r-- | gtk/spice-widget.c | 9 |
1 files changed, 8 insertions, 1 deletions
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); |