gnome-settings-daemon/gnome-settings-daemon-2.22.1-hide-white-screen.patch
Ray Strode d06746449f - Over the releases we've accumulated default.png, default-wide.png
default-5_4.png and default.jpg. We haven't been able to drop them
    because it would leave some users with white backgrounds on upgrade.
    This patch just falls back to the default image if the user's
    background doesn't exist.
2008-03-31 15:07:22 +00:00

31 lines
1.3 KiB
Diff

diff -up gnome-settings-daemon-2.22.1/plugins/background/libbackground/preferences.c.hide-white-screen gnome-settings-daemon-2.22.1/plugins/background/libbackground/preferences.c
--- gnome-settings-daemon-2.22.1/plugins/background/libbackground/preferences.c.hide-white-screen 2008-03-31 10:37:43.000000000 -0400
+++ gnome-settings-daemon-2.22.1/plugins/background/libbackground/preferences.c 2008-03-31 10:39:27.000000000 -0400
@@ -252,6 +252,26 @@ bg_preferences_load (BGPreferences *pref
else
prefs->wallpaper_filename = g_filename_from_utf8 (tmp, -1, NULL,
NULL, NULL);
+
+ if (!g_file_test (prefs->wallpaper_filename, G_FILE_TEST_EXISTS)) {
+ GConfValue *default_value;
+ default_value = gconf_client_get_default_from_schema (client,
+ BG_PREFERENCES_DRAW_BACKGROUND, NULL);
+ if (default_value != NULL) {
+ prefs->enabled = gconf_value_get_bool (default_value);
+ gconf_value_free (default_value);
+
+ g_free (prefs->wallpaper_filename);
+ prefs->wallpaper_filename = NULL;
+
+ default_value = gconf_client_get_default_from_schema (client,
+ BG_PREFERENCES_PICTURE_FILENAME, NULL);
+ if (default_value != NULL) {
+ prefs->wallpaper_filename = g_strdup (gconf_value_get_string (default_value));
+ gconf_value_free (default_value);
+ }
+ }
+ }
}
g_free (tmp);