diff options
-rw-r--r-- | src/nautilus-grid-cell.c | 8 | ||||
-rw-r--r-- | src/nautilus-name-cell.c | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/nautilus-grid-cell.c b/src/nautilus-grid-cell.c index 59b5a33c1..c95f0e5a4 100644 --- a/src/nautilus-grid-cell.c +++ b/src/nautilus-grid-cell.c @@ -116,7 +116,13 @@ update_emblems (NautilusGridCell *self) emblems = nautilus_file_get_emblem_icons (file); for (GList *l = emblems; l != NULL; l = l->next) { - if (!gtk_icon_theme_has_gicon (theme, l->data)) + g_autoptr (GtkIconPaintable) icon_paintable = NULL; + + /* Workaround for gtk_icon_theme_has_gicon() ignoring unthemed icons. + * See: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2789 and + * https://gitlab.gnome.org/GNOME/gtk/-/issues/5709 */ + icon_paintable = gtk_icon_theme_lookup_by_gicon (theme, l->data, 16, 1, 0, 0); + if (g_strcmp0 (gtk_icon_paintable_get_icon_name (icon_paintable), "image-missing") == 0) { g_autofree gchar *icon_string = g_icon_to_string (l->data); g_warning ("Failed to add emblem. ā%sā not found in the icon theme", diff --git a/src/nautilus-name-cell.c b/src/nautilus-name-cell.c index bdcfcc2c7..b4ad20e52 100644 --- a/src/nautilus-name-cell.c +++ b/src/nautilus-name-cell.c @@ -201,7 +201,13 @@ update_emblems (NautilusNameCell *self) emblems = nautilus_file_get_emblem_icons (file); for (GList *l = emblems; l != NULL; l = l->next) { - if (!gtk_icon_theme_has_gicon (theme, l->data)) + g_autoptr (GtkIconPaintable) icon_paintable = NULL; + + /* Workaround for gtk_icon_theme_has_gicon() ignoring unthemed icons. + * See: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2789 and + * https://gitlab.gnome.org/GNOME/gtk/-/issues/5709 */ + icon_paintable = gtk_icon_theme_lookup_by_gicon (theme, l->data, 16, 1, 0, 0); + if (g_strcmp0 (gtk_icon_paintable_get_icon_name (icon_paintable), "image-missing") == 0) { g_autofree gchar *icon_string = g_icon_to_string (l->data); g_warning ("Failed to add emblem. ā%sā not found in the icon theme", |