From cb0a4b875efe49bea8613f22601bb056e3a025e2 Mon Sep 17 00:00:00 2001 From: Consolatis <35009135+Consolatis@users.noreply.github.com> Date: Wed, 8 Oct 2025 18:50:18 +0200 Subject: [PATCH] desktop-entry.c: on detecting a broken icon theme, fall back to hicolor Fixes: #3126 Reported-By: Kreevoz --- src/desktop-entry.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/desktop-entry.c b/src/desktop-entry.c index 7aefa77e..4d61a9dc 100644 --- a/src/desktop-entry.c +++ b/src/desktop-entry.c @@ -108,6 +108,18 @@ desktop_entry_init(struct server *server) sfdo->icon_theme = sfdo_icon_theme_load( sfdo->icon_ctx, rc.icon_theme_name, load_options); + if (!sfdo->icon_theme) { + /* + * sfdo_icon_theme_load() falls back to hicolor theme with + * _ALLOW_MISSING flag when the theme is missing, but just + * fails when the theme is invalid. + * So manually call sfdo_icon_theme_load() again here. + */ + wlr_log(WLR_ERROR, "Failed to load icon theme %s, falling back to 'hicolor'", + rc.icon_theme_name); + sfdo->icon_theme = sfdo_icon_theme_load( + sfdo->icon_ctx, "hicolor", load_options); + } if (!sfdo->icon_theme) { goto err_icon_theme; }