From 4c012cf3db721351d7dee3fba0ed498aaea26be3 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Sun, 23 Jan 2011 03:43:44 +0100 Subject: gtk: add SpiceMainChannel::migration-started With this signal, it is possible for the client to provide sockets to a migrating session. --- gtk/channel-main.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'gtk/channel-main.c') diff --git a/gtk/channel-main.c b/gtk/channel-main.c index 992f999..1ec5193 100644 --- a/gtk/channel-main.c +++ b/gtk/channel-main.c @@ -104,6 +104,7 @@ enum { SPICE_MAIN_CLIPBOARD_GRAB, SPICE_MAIN_CLIPBOARD_REQUEST, SPICE_MAIN_CLIPBOARD_RELEASE, + SPICE_MIGRATION_STARTED, SPICE_MAIN_LAST_SIGNAL, }; @@ -454,6 +455,29 @@ static void spice_main_channel_class_init(SpiceMainChannelClass *klass) G_TYPE_NONE, 0); + /** + * SpiceMainChannel::migration-started: + * @main: the #SpiceMainChannel that emitted the signal + * @session: a migration #SpiceSession + * + * Inform when migration is starting. Application wishing to make + * connections themself can set the #SpiceSession:client-sockets + * to @TRUE, then follow #SpiceSession::channel-new creation, and + * use spice_channel_open_fd() once the socket is created. + * + **/ + signals[SPICE_MIGRATION_STARTED] = + g_signal_new("migration-started", + G_OBJECT_CLASS_TYPE(gobject_class), + G_SIGNAL_RUN_LAST, + 0, + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, + 1, + G_TYPE_OBJECT); + + g_type_class_add_private(klass, sizeof(spice_main_channel)); } @@ -1153,6 +1177,9 @@ static gboolean migrate_connect(gpointer data) g_signal_connect(mig->session, "channel-new", G_CALLBACK(migrate_channel_new_cb), mig); + g_signal_emit(mig->channel, signals[SPICE_MIGRATION_STARTED], 0, + mig->session); + /* the migration process is in 2 steps, first the main channel and then the rest of the channels */ migrate_channel_connect(mig, SPICE_CHANNEL_MAIN, 0); -- cgit v1.2.3