From d6dfb9960cc1c8d25a1dbfaf6958fb82e596c46b Mon Sep 17 00:00:00 2001 From: Ricardo Mones Date: Thu, 16 Feb 2017 00:40:46 +0100 Subject: [PATCH] Fix 'Apply' when changing scaling options only --- src/prefs_themes.c | 4 ++-- src/stock_pixmap.c | 19 +++++++++++++++++++ src/stock_pixmap.h | 1 + 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/prefs_themes.c b/src/prefs_themes.c index fc81582b2..10f6baf9a 100644 --- a/src/prefs_themes.c +++ b/src/prefs_themes.c @@ -1215,8 +1215,8 @@ static void prefs_themes_save(PrefsPage *page) && scaling_ppi != prefs_common.pixmap_scaling_ppi)) { /* same theme, different scaling options */ debug_print("Updating theme scaling\n"); - - main_window_reflect_prefs_all_real(FALSE); + stock_pixmap_invalidate_all_icons(); + main_window_reflect_prefs_all_real(TRUE); compose_reflect_prefs_pixmap_theme(); addrcompl_reflect_prefs_pixmap_theme(); } diff --git a/src/stock_pixmap.c b/src/stock_pixmap.c index 007864d5d..58fc01314 100644 --- a/src/stock_pixmap.c +++ b/src/stock_pixmap.c @@ -839,6 +839,25 @@ void stock_pixmap_themes_list_free(GList *list) g_list_free(list); } +void stock_pixmap_invalidate_all_icons(void) +{ + StockPixmapData *pix_d; + int i = 0; + + while (i < N_STOCK_PIXMAPS) { + pix_d = &pixmaps[i]; + if (pix_d->pixbuf) { + g_object_unref(G_OBJECT(pix_d->pixbuf)); + pix_d->pixbuf = NULL; + } + if (pix_d->pixmap) { + g_object_unref(G_OBJECT(pix_d->pixmap)); + pix_d->pixmap = NULL; + } + i++; + } +} + gchar *stock_pixmap_get_name (StockPixmap icon) { if (icon >= N_STOCK_PIXMAPS) diff --git a/src/stock_pixmap.h b/src/stock_pixmap.h index 582b4fa4b..87fa1c460 100644 --- a/src/stock_pixmap.h +++ b/src/stock_pixmap.h @@ -237,6 +237,7 @@ gint stock_pixbuf_gdk (StockPixmap icon, GdkPixbuf **pixbuf); GList *stock_pixmap_themes_list_new (void); void stock_pixmap_themes_list_free (GList *list); +void stock_pixmap_invalidate_all_icons (void); gchar *stock_pixmap_get_name (StockPixmap icon); StockPixmap stock_pixmap_get_icon (gchar *file); GtkWidget *stock_pixmap_widget_with_overlay (StockPixmap icon, -- 2.25.1