From b2a41685b867d6f16edc016b5271cf9da850a9d7 Mon Sep 17 00:00:00 2001 From: Jens Granseuer Date: Tue, 25 Sep 2007 19:36:18 +0000 Subject: [PATCH] Prevent lots of thumbs from being created with the color scheme of the 2007-09-25 Jens Granseuer Prevent lots of thumbs from being created with the color scheme of the currently active theme (see comment #15 in bug 460023). Maybe it also helps with some of the other color-related issues. * theme-thumbnail.c: (create_gtk_theme_pixbuf), (generate_theme_thumbnail_async): when creating GTK theme thumbnails, explicitly pass the theme's color scheme to override the xsetting svn path=/trunk/; revision=8135 --- capplets/common/ChangeLog | 10 ++++++++++ capplets/common/theme-thumbnail.c | 14 ++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/capplets/common/ChangeLog b/capplets/common/ChangeLog index d67a48be0..097487632 100644 --- a/capplets/common/ChangeLog +++ b/capplets/common/ChangeLog @@ -1,3 +1,13 @@ +2007-09-25 Jens Granseuer + + Prevent lots of thumbs from being created with the color scheme of the + currently active theme (see comment #15 in bug 460023). Maybe it also + helps with some of the other color-related issues. + + * theme-thumbnail.c: (create_gtk_theme_pixbuf), + (generate_theme_thumbnail_async): when creating GTK theme thumbnails, + explicitly pass the theme's color scheme to override the xsetting + 2007-09-16 Jens Granseuer Patch by: Darren Kenny diff --git a/capplets/common/theme-thumbnail.c b/capplets/common/theme-thumbnail.c index 96034c023..f11eb082a 100644 --- a/capplets/common/theme-thumbnail.c +++ b/capplets/common/theme-thumbnail.c @@ -16,6 +16,7 @@ #include #include "theme-thumbnail.h" +#include "gtkrc-utils.h" #include "capplet-util.h" static gint child_pid; @@ -345,7 +346,9 @@ create_gtk_theme_pixbuf (ThemeThumbnailData *theme_thumbnail_data) gint width, height; settings = gtk_settings_get_default (); - g_object_set (settings, "gtk-theme-name", (char *) theme_thumbnail_data->control_theme_name->data, NULL); + g_object_set (settings, "gtk-theme-name", (char *) theme_thumbnail_data->control_theme_name->data, + "gtk-color-scheme", (char *) theme_thumbnail_data->gtk_color_scheme->data, + NULL); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); @@ -975,6 +978,8 @@ generate_theme_thumbnail_async (gpointer theme_info, gpointer user_data, GDestroyNotify destroy) { + gchar *scheme; + if (async_data.set) { ThemeQueueItem *item; @@ -1000,7 +1005,6 @@ generate_theme_thumbnail_async (gpointer theme_info, return; } - if (async_data.channel == NULL) { async_data.channel = g_io_channel_unix_new (pipe_from_factory_fd[0]); @@ -1017,12 +1021,18 @@ generate_theme_thumbnail_async (gpointer theme_info, async_data.user_data = user_data; async_data.destroy = destroy; + if (!strcmp (thumbnail_type, THUMBNAIL_TYPE_GTK)) { + scheme = gtkrc_get_color_scheme_for_theme (theme_name); + gtk_color_scheme = scheme; + } else scheme = NULL; + send_thumbnail_request (thumbnail_type, gtk_theme_name, gtk_color_scheme, metacity_theme_name, icon_theme_name, application_font); + g_free (scheme); } void