[virt-tools-list] [PATCH virt-viewer] spice: the session is connected when main channel opened

Marc-André Lureau marcandre.lureau at gmail.com
Tue Nov 20 23:33:46 UTC 2012


The previous change in 399aae55aa384bf91dff0fc770497c0d5f935fa9 rely
on correct session-connected signal. However, the spice backend
is emiting it too early, when the main channel is created, where
it should wait until it is connected instead.
---
 src/virt-viewer-session-spice.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
index 2577f2b..b1686c5 100644
--- a/src/virt-viewer-session-spice.c
+++ b/src/virt-viewer-session-spice.c
@@ -303,6 +303,7 @@ virt_viewer_session_spice_main_channel_event(SpiceChannel *channel G_GNUC_UNUSED
     switch (event) {
     case SPICE_CHANNEL_OPENED:
         DEBUG_LOG("main channel: opened");
+        g_signal_emit_by_name(session, "session-connected");
         break;
     case SPICE_CHANNEL_CLOSED:
         DEBUG_LOG("main channel: closed");
@@ -523,8 +524,6 @@ virt_viewer_session_spice_channel_new(SpiceSession *s,
         g_signal_connect(channel, "notify::agent-connected", G_CALLBACK(agent_connected_changed), self);
         g_signal_connect(channel, "notify::agent-connected", G_CALLBACK(agent_connected_fullscreen_auto_conf), self);
         agent_connected_fullscreen_auto_conf(channel, NULL, self);
-
-        g_signal_emit_by_name(session, "session-connected");
     }
 
     if (SPICE_IS_DISPLAY_CHANNEL(channel)) {
-- 
1.7.11.7




More information about the virt-tools-list mailing list