diff options
author | Ray Strode <rstrode@redhat.com> | 2017-07-28 16:04:11 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2017-10-20 14:14:14 -0400 |
commit | 5683e5d5a6bc37c7a1b52a633cc79c70b60defb3 (patch) | |
tree | ef4b603dd5e6e991c2c6f5f570b7405559e97918 /daemon/gdm-session-worker.c | |
parent | 932dd92bd4eddd2145db9131b01555987b793463 (diff) | |
download | gdm-5683e5d5a6bc37c7a1b52a633cc79c70b60defb3.tar.gz |
session: add new Initialize method
Right now the worker interface has three methods for starting
a conversation: Setup, SetupForUser, SetupForProgram
Each of these method calls take a large number of overlapping arguments.
Extending these argument lists is painful and breaks upgrades.
This commit adds a new, fourth call, Initialize, which supercedes the
others and just takes a vardict, which is much more extensible.
https://bugzilla.gnome.org/show_bug.cgi?id=788851
Diffstat (limited to 'daemon/gdm-session-worker.c')
-rw-r--r-- | daemon/gdm-session-worker.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c index 890fd91f..66d9e6d1 100644 --- a/daemon/gdm-session-worker.c +++ b/daemon/gdm-session-worker.c @@ -2818,6 +2818,57 @@ gdm_session_worker_handle_open (GdmDBusWorker *object, } static gboolean +gdm_session_worker_handle_initialize (GdmDBusWorker *object, + GDBusMethodInvocation *invocation, + GVariant *details) +{ + GdmSessionWorker *worker = GDM_SESSION_WORKER (object); + GVariantIter iter; + char *key; + GVariant *value; + + validate_and_queue_state_change (worker, invocation, GDM_SESSION_WORKER_STATE_SETUP_COMPLETE); + + g_variant_iter_init (&iter, details); + while (g_variant_iter_loop (&iter, "{sv}", &key, &value)) { + if (g_strcmp0 (key, "service") == 0) { + worker->priv->service = g_strdup (g_variant_get_string (value, NULL)); + } else if (g_strcmp0 (key, "username") == 0) { + worker->priv->username = g_strdup (g_variant_get_string (value, NULL)); + } else if (g_strcmp0 (key, "is-program-session") == 0) { + worker->priv->is_program_session = g_variant_get_boolean (value); + } else if (g_strcmp0 (key, "log-file") == 0) { + worker->priv->log_file = g_strdup (g_variant_get_string (value, NULL)); + } else if (g_strcmp0 (key, "x11-display-name") == 0) { + worker->priv->x11_display_name = g_strdup (g_variant_get_string (value, NULL)); + } else if (g_strcmp0 (key, "x11-authority-file") == 0) { + worker->priv->x11_authority_file = g_strdup (g_variant_get_string (value, NULL)); + } else if (g_strcmp0 (key, "console") == 0) { + worker->priv->display_device = g_strdup (g_variant_get_string (value, NULL)); + } else if (g_strcmp0 (key, "seat-id") == 0) { + worker->priv->display_seat_id = g_strdup (g_variant_get_string (value, NULL)); + } else if (g_strcmp0 (key, "hostname") == 0) { + worker->priv->hostname = g_strdup (g_variant_get_string (value, NULL)); + } else if (g_strcmp0 (key, "display-is-local") == 0) { + worker->priv->display_is_local = g_variant_get_boolean (value); + } else if (g_strcmp0 (key, "display-is-initial") == 0) { + worker->priv->display_is_initial = g_variant_get_boolean (value); + } + } + + g_signal_connect_swapped (worker->priv->user_settings, + "notify::language-name", + G_CALLBACK (on_saved_language_name_read), + worker); + + g_signal_connect_swapped (worker->priv->user_settings, + "notify::session-name", + G_CALLBACK (on_saved_session_name_read), + worker); + return TRUE; +} + +static gboolean gdm_session_worker_handle_setup (GdmDBusWorker *object, GDBusMethodInvocation *invocation, const char *service, @@ -3189,6 +3240,8 @@ gdm_session_worker_constructor (GType type, static void worker_interface_init (GdmDBusWorkerIface *interface) { + interface->handle_initialize = gdm_session_worker_handle_initialize; + /* The next three are for backward compat only */ interface->handle_setup = gdm_session_worker_handle_setup; interface->handle_setup_for_user = gdm_session_worker_handle_setup_for_user; interface->handle_setup_for_program = gdm_session_worker_handle_setup_for_program; |