From: velsinki <112010-velsinki@users.noreply.gitlab.gnome.org> Date: Mon, 24 Apr 2023 21:38:20 +0000 (+0200) Subject: icontheme: make has_(g)icon consistent with lookup X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~378^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e20a5e1bc1670ef59e8df8fe607c9252144d15d3;p=gtk4.git 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 --- 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;