From e20a5e1bc1670ef59e8df8fe607c9252144d15d3 Mon Sep 17 00:00:00 2001 From: velsinki <112010-velsinki@users.noreply.gitlab.gnome.org> Date: Mon, 24 Apr 2023 23:38:20 +0200 Subject: [PATCH] icontheme: make has_(g)icon consistent with lookup Make `gtk_icon_theme_has_icon` and `gtk_icon_theme_has_gicon` also consider unthemed icons. This makes their behavior consistent with the actual (documented) lookup behavior. Fixes: #5709 and makes the workaround in nautilus@b643a00b obsolete --- gtk/gtkicontheme.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index f4191f9a77..b073133401 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -2592,7 +2592,8 @@ gtk_icon_theme_has_icon (GtkIconTheme *self, ensure_valid_themes (self, FALSE); - if (gtk_string_set_lookup (&self->icons, icon_name) != NULL) + if (gtk_string_set_lookup (&self->icons, icon_name) != NULL || + g_hash_table_contains (self->unthemed_icons, icon_name)) { res = TRUE; goto out; @@ -2634,7 +2635,8 @@ gtk_icon_theme_has_gicon (GtkIconTheme *self, for (int i = 0; names[i]; i++) { - if (gtk_string_set_lookup (&self->icons, names[i]) != NULL) + if (gtk_string_set_lookup (&self->icons, names[i]) != NULL || + g_hash_table_contains (self->unthemed_icons, names[i])) { res = TRUE; goto out; -- 2.30.2