commit c6f20ec672a9f6648e63b2286c901cc57e2ba07a
parent 566e109461104843d4a6a6f361b82cc07fb8b982
Author: Colin Leroy <colin@colino.net>
Date: Sun, 18 May 2008 09:43:30 +0000
2008-05-18 [colin] 3.4.0cvs49
* src/stock_pixmap.c
Fix bug with non-updating icons after theme change:
If fetching pixbuf for a given icon after a theme
change, the next pixmap fetch would return the old
cached one, as the theme change was forgotten at
this time. (and vice-versa). This was mostly
visible on open folder icons
Diffstat:
4 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,13 @@
+2008-05-18 [colin] 3.4.0cvs49
+
+ * src/stock_pixmap.c
+ Fix bug with non-updating icons after theme change:
+ If fetching pixbuf for a given icon after a theme
+ change, the next pixmap fetch would return the old
+ cached one, as the theme change was forgotten at
+ this time. (and vice-versa). This was mostly
+ visible on open folder icons
+
2008-05-17 [colin] 3.4.0cvs48
* src/prefs_summaries.c
diff --git a/PATCHSETS b/PATCHSETS
@@ -3344,3 +3344,4 @@
( cvs diff -u -r 1.1.2.2 -r 1.1.2.3 tools/thunderbird-filters-convertor.pl; ) > 3.4.0cvs46.patchset
( cvs diff -u -r 1.179.2.219 -r 1.179.2.220 src/imap.c; ) > 3.4.0cvs47.patchset
( cvs diff -u -r 1.1.2.52 -r 1.1.2.53 src/prefs_summaries.c; cvs diff -u -r 1.395.2.367 -r 1.395.2.368 src/summaryview.c; ) > 3.4.0cvs48.patchset
+( cvs diff -u -r 1.25.2.54 -r 1.25.2.55 src/stock_pixmap.c; ) > 3.4.0cvs49.patchset
diff --git a/configure.ac b/configure.ac
@@ -11,7 +11,7 @@ MINOR_VERSION=4
MICRO_VERSION=0
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=48
+EXTRA_VERSION=49
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
diff --git a/src/stock_pixmap.c b/src/stock_pixmap.c
@@ -410,6 +410,7 @@ gint stock_pixbuf_gdk(GtkWidget *window, StockPixmap icon, GdkPixbuf **pixbuf)
StockPixmapData *pix_d;
static const char *extension[]={".png", ".xpm", NULL};
int i = 0;
+ gboolean theme_changed = FALSE;
if (pixbuf)
*pixbuf = NULL;
@@ -418,9 +419,15 @@ gint stock_pixbuf_gdk(GtkWidget *window, StockPixmap icon, GdkPixbuf **pixbuf)
pix_d = &pixmaps[icon];
- if (!pix_d->pixbuf || (strcmp2(pix_d->icon_path, prefs_common.pixmap_theme_path) != 0)) {
+ theme_changed = (strcmp2(pix_d->icon_path, prefs_common.pixmap_theme_path) != 0);
+ if (!pix_d->pixbuf || theme_changed) {
GdkPixbuf *pix = NULL;
-
+
+ if (theme_changed && pix_d->pixmap) {
+ g_object_unref(pix_d->pixmap);
+ pix_d->pixmap = NULL;
+ }
+
if (strcmp(prefs_common.pixmap_theme_path, DEFAULT_PIXMAP_THEME) != 0) {
if (is_dir_exist(prefs_common.pixmap_theme_path)) {
char *icon_file_name;
@@ -479,6 +486,7 @@ gint stock_pixmap_gdk(GtkWidget *window, StockPixmap icon,
StockPixmapData *pix_d;
static const char *extension[]={".png", ".xpm", NULL};
int i = 0;
+ gboolean theme_changed = FALSE;
if (pixmap) *pixmap = NULL;
if (mask) *mask = NULL;
@@ -488,9 +496,15 @@ gint stock_pixmap_gdk(GtkWidget *window, StockPixmap icon,
pix_d = &pixmaps[icon];
- if (!pix_d->pixmap || (strcmp2(pix_d->icon_path, prefs_common.pixmap_theme_path) != 0)) {
+ theme_changed = (strcmp2(pix_d->icon_path, prefs_common.pixmap_theme_path) != 0);
+ if (!pix_d->pixmap || theme_changed) {
GdkPixmap *pix = NULL;
-
+
+ if (theme_changed && pix_d->pixbuf) {
+ g_object_unref(pix_d->pixbuf);
+ pix_d->pixbuf = NULL;
+ }
+
if (strcmp(prefs_common.pixmap_theme_path, DEFAULT_PIXMAP_THEME) != 0) {
if ( is_dir_exist(prefs_common.pixmap_theme_path) ) {
char *icon_file_name;