diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2011-01-21 14:29:11 +0100 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2011-01-21 19:04:53 +0100 |
commit | 5ebe5dfb90e1e9fbf01d2f8c58d40210a0688e15 (patch) | |
tree | aa748925fdc98492de7999289de8cceecaa3e2a0 | |
parent | 2d8fc15ecf423cd629e5d3796791f144d4c49118 (diff) |
gtk: add channel_up() helper and SPICE_CHANNEL_STATE_MIGRATING
-rw-r--r-- | gtk/spice-channel-priv.h | 2 | ||||
-rw-r--r-- | gtk/spice-channel.c | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/gtk/spice-channel-priv.h b/gtk/spice-channel-priv.h index c49526c..16300a2 100644 --- a/gtk/spice-channel-priv.h +++ b/gtk/spice-channel-priv.h @@ -58,6 +58,7 @@ enum spice_channel_state { SPICE_CHANNEL_STATE_AUTH, SPICE_CHANNEL_STATE_READY, SPICE_CHANNEL_STATE_SWITCHING, + SPICE_CHANNEL_STATE_MIGRATING, }; struct spice_channel { @@ -124,6 +125,7 @@ void spice_msg_out_send(spice_msg_out *out); void spice_msg_out_send_internal(spice_msg_out *out); void spice_msg_out_hexdump(spice_msg_out *out, unsigned char *data, int len); +void spice_channel_up(SpiceChannel *channel); void spice_channel_wakeup(SpiceChannel *channel); SpiceSession* spice_channel_get_session(SpiceChannel *channel); diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c index 0247770..f18f56f 100644 --- a/gtk/spice-channel.c +++ b/gtk/spice-channel.c @@ -769,10 +769,21 @@ static void spice_channel_recv_auth(SpiceChannel *channel) return; } - SPICE_DEBUG("%s: channel up", c->name); c->state = SPICE_CHANNEL_STATE_READY; emit_main_context(channel, SPICE_CHANNEL_EVENT, SPICE_CHANNEL_OPENED); + + if (c->state != SPICE_CHANNEL_STATE_MIGRATING) + spice_channel_up(channel); +} + +G_GNUC_INTERNAL +void spice_channel_up(SpiceChannel *channel) +{ + spice_channel *c = channel->priv; + + SPICE_DEBUG("%s: channel up, state %d", c->name, c->state); + if (SPICE_CHANNEL_GET_CLASS(channel)->channel_up) SPICE_CHANNEL_GET_CLASS(channel)->channel_up(channel); } |