From 0ac3cd01f0f6e2b974f64a9f463d892a4867aa9d Mon Sep 17 00:00:00 2001 From: Jehan Date: Wed, 30 May 2018 23:47:08 +0200 Subject: [PATCH] libgimpwidgets: fix default icon. gtk_window_set_default_icon_name() apparently isn't able to properly fallback to symbolic or non-symbolic variant. So let's test both. There is also gtk_window_set_icon_list() but it takes a list of pixbuf, so I really doubt it is the best solution either. The proposed solution is working ok for now, even though I feel it is again a bit hackish. --- libgimpwidgets/gimpwidgets-private.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libgimpwidgets/gimpwidgets-private.c b/libgimpwidgets/gimpwidgets-private.c index 92fd9c2a08..091930c635 100644 --- a/libgimpwidgets/gimpwidgets-private.c +++ b/libgimpwidgets/gimpwidgets-private.c @@ -65,6 +65,8 @@ gimp_widgets_init (GimpHelpFunc standard_help_func, GimpGetColorFunc get_background_func, GimpEnsureModulesFunc ensure_modules_func) { + GtkIconTheme *icon_theme; + g_return_if_fail (standard_help_func != NULL); if (gimp_widgets_initialized) @@ -79,7 +81,12 @@ gimp_widgets_init (GimpHelpFunc standard_help_func, gimp_icons_init (); - gtk_window_set_default_icon_name (GIMP_ICON_WILBER); + icon_theme = gtk_icon_theme_get_for_screen (gdk_screen_get_default ()); + + if (gtk_icon_theme_has_icon (icon_theme, GIMP_ICON_WILBER "-symbolic")) + gtk_window_set_default_icon_name (GIMP_ICON_WILBER "-symbolic"); + else + gtk_window_set_default_icon_name (GIMP_ICON_WILBER); gimp_widgets_init_foreign_enums ();