gnome-settings-daemon r567 - in trunk: . plugins/screensaver



Author: rodrigo
Date: Wed Oct 29 13:47:55 2008
New Revision: 567
URL: http://svn.gnome.org/viewvc/gnome-settings-daemon?rev=567&view=rev

Log:
2008-10-29  Rodrigo Moya <rodrigo gnome-db org>

	* plugins/screensaver/gsd-screensaver-manager.c
	(gsd_screensaver_manager_start): spawn screensaver process
	in idle callback as it was before.

Modified:
   trunk/ChangeLog
   trunk/plugins/screensaver/gsd-screensaver-manager.c

Modified: trunk/plugins/screensaver/gsd-screensaver-manager.c
==============================================================================
--- trunk/plugins/screensaver/gsd-screensaver-manager.c	(original)
+++ trunk/plugins/screensaver/gsd-screensaver-manager.c	Wed Oct 29 13:47:55 2008
@@ -76,9 +76,8 @@
         g_object_unref (client);
 }
 
-gboolean
-gsd_screensaver_manager_start (GsdScreensaverManager *manager,
-                               GError               **error)
+static gboolean
+start_screensaver_idle_cb (gpointer user_data)
 {
         char        *ss_cmd;
         GError      *gerr = NULL;
@@ -86,24 +85,14 @@
         char        *args[3];
         GConfClient *client;
 
-        g_debug ("Starting screensaver manager");
+        g_debug ("Starting screensaver process in idle callback");
         gnome_settings_profile_start (NULL);
 
-        /*
-	 * with gnome-screensaver, all settings are loaded internally
-	 * from gconf at startup
-	 *
-	 * with xscreensaver, our settings only apply to startup, and
-	 * the screensaver settings are all in xscreensaver and not
-	 * gconf.
-	 *
-	 * we could have xscreensaver-demo run gconftool-2 directly,
-	 * and start / stop xscreensaver here
-         */
-
         client = gconf_client_get_default ();
 
         manager->priv->start_screensaver = gconf_client_get_bool (client, START_SCREENSAVER_KEY, NULL);
+        if (!manager->priv->start_screensaver)
+                return FALSE;
 
         if ((ss_cmd = g_find_program_in_path ("gnome-screensaver"))) {
                 manager->priv->have_gscreensaver = TRUE;
@@ -119,10 +108,6 @@
                 manager->priv->have_xscreensaver = FALSE;
         }
 
-        if (!manager->priv->start_screensaver) {
-                return TRUE;
-        }
-
         if (manager->priv->have_gscreensaver) {
                 args[0] = "gnome-screensaver";
                 args[1] = NULL;
@@ -138,7 +123,7 @@
 
         if (g_spawn_async (g_get_home_dir (), args, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &manager->priv->screensaver_pid, &gerr)) {
                 g_object_unref (client);
-                return TRUE;
+                return FALSE;
         }
 
         show_error = gconf_client_get_bool (client, SHOW_STARTUP_ERRORS_KEY, NULL);
@@ -188,6 +173,32 @@
         return FALSE;
 }
 
+gboolean
+gsd_screensaver_manager_start (GsdScreensaverManager *manager,
+                               GError               **error)
+{
+        g_debug ("Starting screensaver manager");
+        gnome_settings_profile_start (NULL);
+
+        /*
+	 * with gnome-screensaver, all settings are loaded internally
+	 * from gconf at startup
+	 *
+	 * with xscreensaver, our settings only apply to startup, and
+	 * the screensaver settings are all in xscreensaver and not
+	 * gconf.
+	 *
+	 * we could have xscreensaver-demo run gconftool-2 directly,
+	 * and start / stop xscreensaver here
+         */
+
+        g_idle_add ((GFunc) start_screensaver_idle_cb, NULL);
+
+        gnome_settings_profile_end (NULL);
+
+        return FALSE;
+}
+
 void
 gsd_screensaver_manager_stop (GsdScreensaverManager *manager)
 {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]