gnome-screensaver r1438 - in trunk: . src
- From: mccann svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-screensaver r1438 - in trunk: . src
- Date: Mon, 12 May 2008 22:17:13 +0100 (BST)
Author: mccann
Date: Mon May 12 21:17:12 2008
New Revision: 1438
URL: http://svn.gnome.org/viewvc/gnome-screensaver?rev=1438&view=rev
Log:
2008-05-12 William Jon McCann <jmccann redhat com>
* src/gs-manager.c (get_gconf_client), (gs_manager_init),
(gs_manager_finalize), (apply_background_to_window):
Load background from defaults instead of user database.
Modified:
trunk/ChangeLog
trunk/src/gs-manager.c
Modified: trunk/src/gs-manager.c
==============================================================================
--- trunk/src/gs-manager.c (original)
+++ trunk/src/gs-manager.c Mon May 12 21:17:12 2008
@@ -25,6 +25,9 @@
#include <time.h>
#include <gdk/gdk.h>
+#include <gconf/gconf-engine.h>
+#include <gconf/gconf-client.h>
+
#define GNOME_DESKTOP_USE_UNSTABLE_API
#include <libgnomeui/gnome-bg.h>
@@ -975,19 +978,29 @@
static GConfClient *
get_gconf_client (void)
{
- GConfClient *client;
-#if 0
- const char *dest_address;
- GError *error;
- GConfEngine *engine;
+ GConfClient *client;
+ GSList *addresses;
+ GError *error;
+ GConfEngine *engine;
+
+ client = NULL;
+ addresses = NULL;
+
+ addresses = g_slist_prepend (addresses, "xml:merged:" SYSCONFDIR "/gconf/gconf.xml.mandatory");
+ addresses = g_slist_prepend (addresses, "xml:merged:" SYSCONFDIR "/gconf/gconf.xml.system");
+ addresses = g_slist_prepend (addresses, "xml:merged:" SYSCONFDIR "/gconf/gconf.xml.defaults");
+ addresses = g_slist_reverse (addresses);
- dest_address = "xml:merged:/etc/gconf/gconf.xml.mandatory";
error = NULL;
- engine = gconf_engine_get_local (dest_address, &error);
- client = gconf_client_get_for_engine (engine);
-#else
- client = gconf_client_get_default ();
-#endif
+ engine = gconf_engine_get_for_addresses (addresses, &error);
+ if (engine == NULL) {
+ gs_debug ("Unable to get gconf engine for addresses: %s", error->message);
+ } else {
+ client = gconf_client_get_for_engine (engine);
+ }
+
+ g_slist_free (addresses);
+
return client;
}
@@ -1000,18 +1013,18 @@
manager->priv->grab = gs_grab_new ();
manager->priv->theme_manager = gs_theme_manager_new ();
- /* FIXME: use a client that gives us system defaults */
manager->priv->client = get_gconf_client ();
- manager->priv->bg = gnome_bg_new ();
+ if (manager->priv->client != NULL) {
+ manager->priv->bg = gnome_bg_new ();
- g_signal_connect (manager->priv->bg,
- "changed",
- G_CALLBACK (on_bg_changed),
- manager);
- watch_bg_preferences (manager);
+ g_signal_connect (manager->priv->bg,
+ "changed",
+ G_CALLBACK (on_bg_changed),
+ manager);
+ watch_bg_preferences (manager);
- /* FIXME: should only load from defaults */
- gnome_bg_load_from_preferences (manager->priv->bg, manager->priv->client);
+ gnome_bg_load_from_preferences (manager->priv->bg, manager->priv->client);
+ }
}
static void
@@ -1051,6 +1064,9 @@
manager->priv->bg_notify_id);
manager->priv->bg_notify_id = 0;
}
+ if (manager->priv->bg != NULL) {
+ g_object_unref (manager->priv->bg);
+ }
if (manager->priv->client != NULL) {
g_object_unref (manager->priv->client);
}
@@ -1309,6 +1325,11 @@
int width;
int height;
+ if (manager->priv->bg == NULL) {
+ gs_debug ("No background available");
+ gs_window_set_background_pixmap (window, NULL);
+ }
+
screen = gs_window_get_screen (window);
width = gdk_screen_get_width (screen);
height = gdk_screen_get_height (screen);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]