libgimpwidgets: gtk-fallback-icon-theme is deprecated...

since GTK 3.10 and according to the GTK3 documentation the setting
is ignored.

Remove the reference to it and thus setting a fallback. According to
the GTK docs `hicolor` is the fallback icon theme.
Since `gimp_icons_notify_system_icon_theme` was only used to add
the fallback, remove the function and setting it with
`g_signal_connect`.
This commit is contained in:
Jacob Boerema 2025-03-26 16:36:09 -04:00
parent 3879520cc2
commit 7add94f868

View file

@ -117,39 +117,6 @@ gimp_icons_change_icon_theme (GFile *new_search_path)
g_object_unref (old_search_path);
}
static void
gimp_icons_notify_system_icon_theme (GObject *settings,
GParamSpec *param,
gpointer unused)
{
GdkScreen *screen = gdk_screen_get_default ();
GValue value = G_VALUE_INIT;
g_value_init (&value, G_TYPE_STRING);
if (gdk_screen_get_setting (screen, "gtk-icon-theme-name", &value))
{
const gchar *new_system_icon_theme = g_value_get_string (&value);
gchar *cur_system_icon_theme = NULL;
g_object_get (settings,
"gtk-fallback-icon-theme", &cur_system_icon_theme,
NULL);
if (g_strcmp0 (cur_system_icon_theme, new_system_icon_theme))
{
g_object_set (settings,
"gtk-fallback-icon-theme", new_system_icon_theme,
NULL);
g_object_notify (settings, "gtk-icon-theme-name");
}
g_free (cur_system_icon_theme);
}
g_value_unset (&value);
}
static gboolean
gimp_icons_sanity_check (GFile *path,
const gchar *theme_name)
@ -246,7 +213,6 @@ gimp_icons_init (void)
GdkPixbuf *pixbuf;
GError *error = NULL;
gchar *icons_dir;
gchar *system_icon_theme;
gchar *gimp_icon_theme;
if (initialized)
@ -289,18 +255,12 @@ gimp_icons_init (void)
settings = gtk_settings_get_for_screen (gdk_screen_get_default ());
g_object_get (settings, "gtk-icon-theme-name", &system_icon_theme, NULL);
g_object_set (settings,
"gtk-fallback-icon-theme", system_icon_theme,
"gtk-icon-theme-name", gimp_icon_theme,
NULL);
g_free (gimp_icon_theme);
g_free (system_icon_theme);
g_signal_connect (settings, "notify::gtk-icon-theme-name",
G_CALLBACK (gimp_icons_notify_system_icon_theme), NULL);
pixbuf = gdk_pixbuf_new_from_resource ("/org/gimp/icons/64/gimp-wilber-eek.png",
&error);