diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2011-04-10 03:15:40 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2011-04-10 03:15:42 +0200 |
commit | b6470a71682b9476ea6b33a7d664fe8bdda40f25 (patch) | |
tree | 6cb6e447e12b4c832ec09773b0aa20e311794497 | |
parent | ba4d885d6a91bbf9d727a9a44dd63df671f1013b (diff) |
gtk: calling connect() on a connecting channel is fine
This avoid problems where different display shares the same input
channel and try to connect two times.
-rw-r--r-- | gtk/spice-channel.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c index 241c4c1..ea5ba0b 100644 --- a/gtk/spice-channel.c +++ b/gtk/spice-channel.c @@ -2004,6 +2004,12 @@ static gboolean channel_connect(SpiceChannel *channel) **/ gboolean spice_channel_connect(SpiceChannel *channel) { + g_return_val_if_fail(SPICE_IS_CHANNEL(channel), FALSE); + spice_channel *c = channel->priv; + + if (c->state == SPICE_CHANNEL_STATE_CONNECTING) + return TRUE; + return channel_connect(channel); } |