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 1/7] 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; } From 814af0ae4db881bba934e0076144570057242770 Mon Sep 17 00:00:00 2001 From: Consolatis <35009135+Consolatis@users.noreply.github.com> Date: Wed, 8 Oct 2025 19:47:57 +0200 Subject: [PATCH 2/7] desktop-entry.c: don't demote error messages with LABWC_DEBUG_LIBSFDO Also add additional logging to tell users how to get more information about failures to load the icon theme. --- src/desktop-entry.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/desktop-entry.c b/src/desktop-entry.c index 4d61a9dc..79b015f2 100644 --- a/src/desktop-entry.c +++ b/src/desktop-entry.c @@ -37,9 +37,10 @@ log_handler(enum sfdo_log_level level, const char *fmt, va_list args, void *tag) /* * To avoid logging issues with .desktop files as errors, all libsfdo - * error-logging is demoted to info level. + * error-logging is demoted to info level unless running with + * LABWC_DEBUG_LIBSFDO. */ - if (level == SFDO_LOG_LEVEL_ERROR) { + if (!debug_libsfdo && level == SFDO_LOG_LEVEL_ERROR) { level = SFDO_LOG_LEVEL_INFO; } @@ -117,6 +118,12 @@ desktop_entry_init(struct server *server) */ wlr_log(WLR_ERROR, "Failed to load icon theme %s, falling back to 'hicolor'", rc.icon_theme_name); + + if (!debug_libsfdo) { + wlr_log(WLR_ERROR, "Further information is available by setting " + "the LABWC_DEBUG_LIBSFDO=1 env var before starting labwc"); + } + sfdo->icon_theme = sfdo_icon_theme_load( sfdo->icon_ctx, "hicolor", load_options); } @@ -141,6 +148,10 @@ err_desktop_ctx: err_basedir_ctx: free(sfdo); wlr_log(WLR_ERROR, "Failed to initialize icon loader"); + if (!debug_libsfdo) { + wlr_log(WLR_ERROR, "Further information is available by setting " + "the LABWC_DEBUG_LIBSFDO=1 env var before starting labwc"); + } } void From 017152da52d500cec0f60f51870c29422844e8ca Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Wed, 8 Oct 2025 20:57:45 +0100 Subject: [PATCH 3/7] build: use spaces instead of tab --- clients/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/meson.build b/clients/meson.build index c131915d..54b92db8 100644 --- a/clients/meson.build +++ b/clients/meson.build @@ -51,7 +51,7 @@ executable( epoll_dep, ], include_directories: [labwc_inc], - install: true + install: true, ) clients = files('lab-sensible-terminal') From 7166efe7bf3fe239b73b394759f59835653d6d32 Mon Sep 17 00:00:00 2001 From: Consolatis <35009135+Consolatis@users.noreply.github.com> Date: Wed, 8 Oct 2025 22:10:24 +0200 Subject: [PATCH 4/7] CI: also run on clients/ changes --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e2876ac9..a9ccbb06 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,7 @@ on: - 'src/**' - 'include/**' - 'protocols/**' + - 'clients/**' - 'scripts/**' - '.github/workflows/**' From c27d4955a42184c2bd593cd4c2e1725a2d7f3cf6 Mon Sep 17 00:00:00 2001 From: tokyo4j Date: Wed, 8 Oct 2025 18:32:30 +0900 Subject: [PATCH 5/7] desktop-entry: fix wrong description of sfdo-icon flags --- src/desktop-entry.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/desktop-entry.c b/src/desktop-entry.c index 79b015f2..7617fa26 100644 --- a/src/desktop-entry.c +++ b/src/desktop-entry.c @@ -96,15 +96,15 @@ desktop_entry_init(struct server *server) * We set some relaxed load options to accommodate delinquent themes in * the wild, namely: * - * - SFDO_ICON_THEME_LOAD_OPTION_ALLOW_MISSING to "impose less - * restrictions on the format of icon theme files" + * - SFDO_ICON_THEME_LOAD_OPTION_RELAXED to "impose less restrictions + * on the format of icon theme files" * - * - SFDO_ICON_THEME_LOAD_OPTION_RELAXED to "continue loading even if it - * fails to find a theme or one of its dependencies." + * - SFDO_ICON_THEME_LOAD_OPTION_ALLOW_MISSING to "continue loading + * even if it fails to find a theme or one of its dependencies." */ int load_options = SFDO_ICON_THEME_LOAD_OPTIONS_DEFAULT - | SFDO_ICON_THEME_LOAD_OPTION_ALLOW_MISSING - | SFDO_ICON_THEME_LOAD_OPTION_RELAXED; + | SFDO_ICON_THEME_LOAD_OPTION_RELAXED + | SFDO_ICON_THEME_LOAD_OPTION_ALLOW_MISSING; sfdo->icon_theme = sfdo_icon_theme_load( sfdo->icon_ctx, From 474c513ed6565df300b91e44d3ec77f9da5105c5 Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Thu, 9 Oct 2025 09:39:59 +0200 Subject: [PATCH 6/7] fix double free for libxml2 < 2.13 xmlAddChild() only unlinks the second argument since libxml2 2.13. regression from 503af105 --- src/common/xml.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/xml.c b/src/common/xml.c index 7e089267..57c415ec 100644 --- a/src/common/xml.c +++ b/src/common/xml.c @@ -79,7 +79,8 @@ merge_two_trees(xmlNode *dst, xmlNode *src) && !strcasecmp((char *)dst->name, (char *)src->name)) { xmlNode *next_dst = dst->last; xmlNode *next_src = src->children; - xmlAddChild(dst, src->children); + xmlUnlinkNode(next_src); + xmlAddChild(dst, next_src); xmlUnlinkNode(src); xmlFreeNode(src); src = next_src; From e1820adcd3367cc5e5459c6f3fcecb8c62f4f747 Mon Sep 17 00:00:00 2001 From: Tobias Bengfort Date: Thu, 9 Oct 2025 09:45:36 +0200 Subject: [PATCH 7/7] fix typo in comment --- src/common/xml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/xml.c b/src/common/xml.c index 57c415ec..0185d9a3 100644 --- a/src/common/xml.c +++ b/src/common/xml.c @@ -48,7 +48,7 @@ create_attribute_tree(const xmlAttr *attr) } /* - * Consider . + * Consider . * These three attributes are represented by following trees. * action(dst)---name * action(src)---position---x