diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2013-04-10 15:30:33 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2013-04-10 19:33:39 +0200 |
commit | 4574ddd86c185c4a733beb3fc91a6d9fda5a5d2a (patch) | |
tree | 09b20e38a0e13abcfc616392a2d727ace8a04e56 | |
parent | ca0b62b593021adb53955cdefecd78b88a89bc1d (diff) |
spicy-ss: quit when channel error
-rw-r--r-- | gtk/spicy-screenshot.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gtk/spicy-screenshot.c b/gtk/spicy-screenshot.c index 2595d0c..43664b6 100644 --- a/gtk/spicy-screenshot.c +++ b/gtk/spicy-screenshot.c @@ -95,10 +95,28 @@ static void invalidate(SpiceChannel *channel, g_main_loop_quit(mainloop); } +static void main_channel_event(SpiceChannel *channel, SpiceChannelEvent event, + gpointer data) +{ + switch (event) { + case SPICE_CHANNEL_OPENED: + break; + default: + g_warning("main channel event: %d", event); + g_main_loop_quit(mainloop); + } +} + static void channel_new(SpiceSession *s, SpiceChannel *channel, gpointer *data) { int id; + if (SPICE_IS_MAIN_CHANNEL(channel)) { + g_signal_connect(channel, "channel-event", + G_CALLBACK(main_channel_event), data); + return; + } + if (!SPICE_IS_DISPLAY_CHANNEL(channel)) return; |