1
Index: gnome-settings-daemon-3.6.1/plugins/background/gsd-background-manager.c
2
===================================================================
3
--- gnome-settings-daemon-3.6.1.orig/plugins/background/gsd-background-manager.c 2012-05-24 11:50:44.000000000 +0200
4
+++ gnome-settings-daemon-3.6.1/plugins/background/gsd-background-manager.c 2012-10-26 10:19:49.567004179 +0200
6
setup_bg_and_draw_background (manager);
10
+set_accountsservice_background (const gchar *background)
12
+ GDBusProxy *proxy = NULL;
13
+ GDBusProxy *user = NULL;
14
+ GVariant *variant = NULL;
15
+ GError *error = NULL;
16
+ gchar *object_path = NULL;
18
+ proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
19
+ G_DBUS_PROXY_FLAGS_NONE,
21
+ "org.freedesktop.Accounts",
22
+ "/org/freedesktop/Accounts",
23
+ "org.freedesktop.Accounts",
27
+ if (proxy == NULL) {
28
+ g_warning ("Failed to contact accounts service: %s", error->message);
29
+ g_error_free (error);
33
+ variant = g_dbus_proxy_call_sync (proxy,
35
+ g_variant_new ("(s)", g_get_user_name ()),
36
+ G_DBUS_CALL_FLAGS_NONE,
41
+ if (variant == NULL) {
42
+ g_warning ("Could not contact accounts service to look up '%s': %s",
43
+ g_get_user_name (), error->message);
44
+ g_error_free (error);
48
+ g_variant_get (variant, "(o)", &object_path);
49
+ user = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
50
+ G_DBUS_PROXY_FLAGS_NONE,
52
+ "org.freedesktop.Accounts",
54
+ "org.freedesktop.Accounts.User",
57
+ g_free (object_path);
60
+ g_warning ("Could not create proxy for user '%s': %s",
61
+ g_variant_get_string (variant, NULL), error->message);
62
+ g_error_free (error);
65
+ g_variant_unref (variant);
67
+ variant = g_dbus_proxy_call_sync (user,
68
+ "SetBackgroundFile",
69
+ g_variant_new ("(s)", background ? background : ""),
70
+ G_DBUS_CALL_FLAGS_NONE,
75
+ if (variant == NULL) {
76
+ g_warning ("Failed to set the background '%s': %s", background, error->message);
77
+ g_error_free (error);
83
+ g_object_unref (proxy);
84
+ if (variant != NULL)
85
+ g_variant_unref (variant);
89
+picture_uri_changed (GSettings *settings,
91
+ GsdBackgroundManager *manager)
93
+ const char *picture_uri = g_settings_get_string (settings, key);
94
+ GFile *picture_file = g_file_new_for_uri (picture_uri);
95
+ char *picture_path = g_file_get_path (picture_file);
96
+ set_accountsservice_background (picture_path);
97
+ g_free (picture_path);
98
+ g_object_unref (picture_file);
102
gsd_background_manager_start (GsdBackgroundManager *manager,
105
manager->priv->settings = g_settings_new ("org.gnome.desktop.background");
106
g_signal_connect (manager->priv->settings, "changed::draw-background",
107
G_CALLBACK (draw_background_changed), manager);
108
+ g_signal_connect (manager->priv->settings, "changed::picture-uri",
109
+ G_CALLBACK (picture_uri_changed), manager);
111
/* If this is set, nautilus will draw the background and is
112
* almost definitely in our session. however, it may not be