]> git.mdlowis.com Git - proto/labwc.git/commitdiff
desktop-entry.c: on detecting a broken icon theme, fall back to hicolor
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Wed, 8 Oct 2025 16:50:18 +0000 (18:50 +0200)
committerJohan Malm <johanmalm@users.noreply.github.com>
Wed, 8 Oct 2025 19:23:12 +0000 (20:23 +0100)
Fixes: #3126
Reported-By: Kreevoz
src/desktop-entry.c

index 7aefa77e6567811fce973d2766d5429e3b33d6cf..4d61a9dca203162097ef938f9482d5b7b597b21a 100644 (file)
@@ -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;
        }