diff --git a/gnome-control-center-symlinked-background.patch b/gnome-control-center-symlinked-background.patch new file mode 100644 index 0000000..c9f0fb7 --- /dev/null +++ b/gnome-control-center-symlinked-background.patch @@ -0,0 +1,115 @@ +Index: gnome-control-center-2.32.1/capplets/appearance/appearance-desktop.c +=================================================================== +--- gnome-control-center-2.32.1.orig/capplets/appearance/appearance-desktop.c ++++ gnome-control-center-2.32.1/capplets/appearance/appearance-desktop.c +@@ -48,6 +48,50 @@ static const GtkTargetEntry drag_types[] + + static void wp_update_preview (GtkFileChooser *chooser, AppearanceData *data); + ++static GnomeWPItem * ++lookup_with_symlink (AppearanceData *data, ++ const char *path, ++ char **real_path) ++{ ++ GnomeWPItem *item; ++ gchar *readlink; ++ ++ if (real_path) ++ *real_path = NULL; ++ ++ if (!path) ++ return NULL; ++ ++ item = g_hash_table_lookup (data->wp_hash, path); ++ if (item) ++ return item; ++ ++ /* if the current background is not in the hash of known backgrounds, ++ * see if it's a symlink and if the file it points to is in the hash */ ++ ++ readlink = g_strdup (path); ++ ++ while (readlink && ++ g_file_test (readlink, G_FILE_TEST_IS_SYMLINK) && ++ item == NULL) { ++ gchar *new; ++ ++ new = g_file_read_link (readlink, NULL); ++ g_free (readlink); ++ readlink = new; ++ ++ if (readlink) ++ item = g_hash_table_lookup (data->wp_hash, readlink); ++ } ++ ++ if (item != NULL && real_path) ++ *real_path = readlink; ++ else ++ g_free (readlink); ++ ++ return item; ++} ++ + static void + select_item (AppearanceData *data, + GnomeWPItem * item, +@@ -418,11 +462,16 @@ wp_uri_changed (const gchar *uri, + AppearanceData *data) + { + GnomeWPItem *item, *selected; ++ gchar *realuri; ++ ++ realuri = NULL; ++ item = lookup_with_symlink (data, uri, &realuri); ++ if (!realuri) ++ realuri = g_strdup (uri); + +- item = g_hash_table_lookup (data->wp_hash, uri); + selected = get_selected_item (data, NULL); + +- if (selected != NULL && strcmp (selected->filename, uri) != 0) ++ if (selected != NULL && strcmp (selected->filename, realuri) != 0) + { + if (item == NULL) + item = wp_add_image (data, uri); +@@ -430,6 +479,8 @@ wp_uri_changed (const gchar *uri, + if (item) + select_item (data, item, TRUE); + } ++ ++ g_free (realuri); + } + + static void +@@ -936,6 +987,7 @@ wp_load_stuffs (void *user_data) + AppearanceData *data; + gchar *imagepath, *uri, *style; + GnomeWPItem *item; ++ gchar *realpath; + + data = (AppearanceData *) user_data; + +@@ -971,7 +1023,12 @@ wp_load_stuffs (void *user_data) + + g_free (uri); + +- item = g_hash_table_lookup (data->wp_hash, imagepath); ++ realpath = NULL; ++ item = lookup_with_symlink (data, imagepath, &realpath); ++ if (realpath) { ++ g_free (imagepath); ++ imagepath = realpath; ++ } + + if (item != NULL) + { +@@ -986,7 +1043,9 @@ wp_load_stuffs (void *user_data) + wp_props_load_wallpaper (item->filename, item, data); + } + ++ data->wp_update_gconf = FALSE; + select_item (data, item, FALSE); ++ data->wp_update_gconf = TRUE; + } + } + else if (strcmp (style, "none") != 0) diff --git a/gnome-control-center.changes b/gnome-control-center.changes index 2c9515c..187f3c7 100644 --- a/gnome-control-center.changes +++ b/gnome-control-center.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon Feb 21 13:53:37 CET 2011 - vuntz@opensuse.org + +- Add gnome-control-center-symlinked-background.patch: if the + configured background is not known by the backgrourd capplet, but + it's a symlink to another background which is known, then we only + want to display this background once. This is useful in openSUSE, + since the default configured background is such a symlink. + ------------------------------------------------------------------- Sun Feb 13 12:50:11 CET 2011 - vuntz@opensuse.org diff --git a/gnome-control-center.spec b/gnome-control-center.spec index 8a736a4..171aec6 100644 --- a/gnome-control-center.spec +++ b/gnome-control-center.spec @@ -61,6 +61,8 @@ Patch0: gnome-control-center-shell-common-tasks-i18n.patch Patch1: gnome-control-center-bnc427745-force-dpi.patch # PATCH-FIX-UPSTREAM gnome-control-center-mime-scheme-handler.patch vuntz@opensuse.org -- Use x-scheme-handler/* mime types to set default web browser and mailer. Cherry-picked to gonme-2-32 branch from master/3.0 branch Patch2: gnome-control-center-mime-scheme-handler.patch +# PATCH-FIX-OPENSUSE gnome-control-center-symlinked-background.patch vuntz@opensuse.org -- Do not show twice the configured background, if it is a symlink to a known background. This only applies to 2.32.x, and is not needed on 3.0, so there's no need to send it upstream +Patch3: gnome-control-center-symlinked-background.patch # PATCH-NEEDS-REBASE gnome-control-center-system-proxy-configuration.patch -- this needs to be reimplemented to be more distro-generic before submitting upstream - docs at http://en.opensuse.org/GNOME/Proxy_configuration (was PATCH-FEATURE-OPENSUSE) Patch14: gnome-control-center-system-proxy-configuration.patch # PATCH-FEATURE-OPENSUSE gnome-control-center-use-settings-menu.patch @@ -119,6 +121,7 @@ gnome-patch-translation-prepare %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 #NEEDS-REBASE #%patch14 -p1 %patch28