[gnome-settings-daemon] main: Only start the manager after registering with gnome session
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] main: Only start the manager after registering with gnome session
- Date: Fri, 26 Oct 2012 09:40:22 +0000 (UTC)
commit c38e15583a0a8c7b2f6982b79e85143c056c4855
Author: Rui Matos <tiagomatos gmail com>
Date: Wed Oct 24 18:23:03 2012 +0200
main: Only start the manager after registering with gnome session
This ensures that any plugin idles will only run after RegisterClient
but also that we only call RegisterClient after Setenv since otherwise
Setenv isn't effective.
https://bugzilla.gnome.org/show_bug.cgi?id=686814
gnome-settings-daemon/main.c | 60 +++++++++++++++++++----------------------
1 files changed, 28 insertions(+), 32 deletions(-)
---
diff --git a/gnome-settings-daemon/main.c b/gnome-settings-daemon/main.c
index fdcb497..86be40d 100644
--- a/gnome-settings-daemon/main.c
+++ b/gnome-settings-daemon/main.c
@@ -133,6 +133,29 @@ got_client_proxy (GObject *object,
}
static void
+start_settings_manager (void)
+{
+ gboolean res;
+ GError *error;
+
+ gnome_settings_profile_start ("gnome_settings_manager_new");
+ manager = gnome_settings_manager_new ();
+ gnome_settings_profile_end ("gnome_settings_manager_new");
+ if (manager == NULL) {
+ g_warning ("Unable to register object");
+ gtk_main_quit ();
+ }
+
+ error = NULL;
+ res = gnome_settings_manager_start (manager, &error);
+ if (! res) {
+ g_warning ("Unable to start: %s", error->message);
+ g_error_free (error);
+ gtk_main_quit ();
+ }
+}
+
+static void
on_client_registered (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
@@ -161,6 +184,8 @@ on_client_registered (GObject *source_object,
g_free (object_path);
g_variant_unref (variant);
}
+
+ start_settings_manager ();
}
static void
@@ -316,12 +341,12 @@ watch_for_term_signal (GnomeSettingsManager *manager)
}
static void
-set_session_over_handler (GDBusConnection *bus)
+name_acquired_handler (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
{
GDBusProxy *proxy;
- g_assert (bus != NULL);
-
proxy = gnome_settings_session_get_session_proxy ();
/* Always call this first, as Setenv can only be called before
any client registers */
@@ -334,14 +359,6 @@ set_session_over_handler (GDBusConnection *bus)
}
static void
-name_acquired_handler (GDBusConnection *connection,
- const gchar *name,
- gpointer user_data)
-{
- set_session_over_handler (connection);
-}
-
-static void
name_lost_handler (GDBusConnection *connection,
const gchar *name,
gpointer user_data)
@@ -419,10 +436,6 @@ parse_args (int *argc, char ***argv)
int
main (int argc, char *argv[])
{
-
- gboolean res;
- GError *error;
-
gnome_settings_profile_start (NULL);
bindtextdomain (GETTEXT_PACKAGE, GNOME_SETTINGS_LOCALEDIR);
@@ -447,22 +460,6 @@ main (int argc, char *argv[])
bus_register ();
- gnome_settings_profile_start ("gnome_settings_manager_new");
- manager = gnome_settings_manager_new ();
- gnome_settings_profile_end ("gnome_settings_manager_new");
- if (manager == NULL) {
- g_warning ("Unable to register object");
- goto out;
- }
-
- error = NULL;
- res = gnome_settings_manager_start (manager, &error);
- if (! res) {
- g_warning ("Unable to start: %s", error->message);
- g_error_free (error);
- goto out;
- }
-
if (do_timed_exit) {
g_timeout_add_seconds (30, (GSourceFunc) timed_exit_cb, NULL);
}
@@ -471,7 +468,6 @@ main (int argc, char *argv[])
g_debug ("Shutting down");
-out:
if (name_id > 0) {
g_bus_unown_name (name_id);
name_id = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]