summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Alexander Steffens (heftig) <jan.steffens@gmail.com>2017-10-31 17:22:34 +0100
committerRay Strode <rstrode@redhat.com>2017-10-31 13:14:10 -0400
commite3f731c5ef80b93b9dde2c97b6ab11535b5eddda (patch)
tree4a5e1038218983faa96622a8d84ac29eef5bb77d
parentc793c5ba0a249025ddb1d6d2aa24575c88a32751 (diff)
downloadgdm-e3f731c5ef80b93b9dde2c97b6ab11535b5eddda.tar.gz
session-worker: Adjust Initialize to behave more like SetupFor*
Most importantly, wait for the user settings to be loaded. https://bugzilla.gnome.org/show_bug.cgi?id=789722
-rw-r--r--daemon/gdm-session-worker.c39
1 files changed, 31 insertions, 8 deletions
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
index a1e46366..e855a4df 100644
--- a/daemon/gdm-session-worker.c
+++ b/daemon/gdm-session-worker.c
@@ -2984,8 +2984,10 @@ gdm_session_worker_handle_initialize (GdmDBusWorker *object,
GVariantIter iter;
char *key;
GVariant *value;
+ gboolean wait_for_settings = FALSE;
- validate_and_queue_state_change (worker, invocation, GDM_SESSION_WORKER_STATE_SETUP_COMPLETE);
+ if (!validate_state_change (worker, invocation, GDM_SESSION_WORKER_STATE_SETUP_COMPLETE))
+ return TRUE;
g_variant_iter_init (&iter, details);
while (g_variant_iter_loop (&iter, "{sv}", &key, &value)) {
@@ -3016,15 +3018,36 @@ gdm_session_worker_handle_initialize (GdmDBusWorker *object,
}
}
- g_signal_connect_swapped (worker->priv->user_settings,
- "notify::language-name",
- G_CALLBACK (on_saved_language_name_read),
- worker);
+ worker->priv->pending_invocation = invocation;
- g_signal_connect_swapped (worker->priv->user_settings,
- "notify::session-name",
- G_CALLBACK (on_saved_session_name_read),
+ if (!worker->priv->is_program_session) {
+ 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);
+
+ if (worker->priv->username) {
+ wait_for_settings = !gdm_session_settings_load (worker->priv->user_settings,
+ worker->priv->username);
+ }
+ }
+
+ if (wait_for_settings) {
+ /* Load settings from accounts daemon before continuing
+ */
+ g_signal_connect (G_OBJECT (worker->priv->user_settings),
+ "notify::is-loaded",
+ G_CALLBACK (on_settings_is_loaded_changed),
worker);
+ } else {
+ queue_state_change (worker);
+ }
+
return TRUE;
}