Compare commits

...

7 commits

Author SHA1 Message Date
Tobias Bengfort
e1820adcd3 fix typo in comment 2025-10-10 00:19:22 +09:00
Tobias Bengfort
474c513ed6 fix double free for libxml2 < 2.13
xmlAddChild() only unlinks the second argument since libxml2 2.13.

regression from 503af105
2025-10-10 00:19:22 +09:00
tokyo4j
c27d4955a4 desktop-entry: fix wrong description of sfdo-icon flags 2025-10-09 00:59:43 +02:00
Consolatis
7166efe7bf CI: also run on clients/ changes 2025-10-08 22:17:48 +02:00
Johan Malm
017152da52 build: use spaces instead of tab 2025-10-08 21:05:25 +01:00
Consolatis
814af0ae4d 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.
2025-10-08 20:23:12 +01:00
Consolatis
cb0a4b875e desktop-entry.c: on detecting a broken icon theme, fall back to hicolor
Fixes: #3126
Reported-By: Kreevoz
2025-10-08 20:23:12 +01:00
4 changed files with 36 additions and 11 deletions

View file

@ -17,6 +17,7 @@ on:
- 'src/**' - 'src/**'
- 'include/**' - 'include/**'
- 'protocols/**' - 'protocols/**'
- 'clients/**'
- 'scripts/**' - 'scripts/**'
- '.github/workflows/**' - '.github/workflows/**'

View file

@ -51,7 +51,7 @@ executable(
epoll_dep, epoll_dep,
], ],
include_directories: [labwc_inc], include_directories: [labwc_inc],
install: true install: true,
) )
clients = files('lab-sensible-terminal') clients = files('lab-sensible-terminal')

View file

@ -48,7 +48,7 @@ create_attribute_tree(const xmlAttr *attr)
} }
/* /*
* Consider <keybind name.action="ShowMenu" x.position.action="1" y.position="2" />. * Consider <keybind name.action="ShowMenu" x.position.action="1" y.position.action="2" />.
* These three attributes are represented by following trees. * These three attributes are represented by following trees.
* action(dst)---name * action(dst)---name
* action(src)---position---x * action(src)---position---x
@ -79,7 +79,8 @@ merge_two_trees(xmlNode *dst, xmlNode *src)
&& !strcasecmp((char *)dst->name, (char *)src->name)) { && !strcasecmp((char *)dst->name, (char *)src->name)) {
xmlNode *next_dst = dst->last; xmlNode *next_dst = dst->last;
xmlNode *next_src = src->children; xmlNode *next_src = src->children;
xmlAddChild(dst, src->children); xmlUnlinkNode(next_src);
xmlAddChild(dst, next_src);
xmlUnlinkNode(src); xmlUnlinkNode(src);
xmlFreeNode(src); xmlFreeNode(src);
src = next_src; src = next_src;

View file

@ -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 * 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; level = SFDO_LOG_LEVEL_INFO;
} }
@ -95,19 +96,37 @@ desktop_entry_init(struct server *server)
* We set some relaxed load options to accommodate delinquent themes in * We set some relaxed load options to accommodate delinquent themes in
* the wild, namely: * the wild, namely:
* *
* - SFDO_ICON_THEME_LOAD_OPTION_ALLOW_MISSING to "impose less * - SFDO_ICON_THEME_LOAD_OPTION_RELAXED to "impose less restrictions
* restrictions on the format of icon theme files" * on the format of icon theme files"
* *
* - SFDO_ICON_THEME_LOAD_OPTION_RELAXED to "continue loading even if it * - SFDO_ICON_THEME_LOAD_OPTION_ALLOW_MISSING to "continue loading
* fails to find a theme or one of its dependencies." * even if it fails to find a theme or one of its dependencies."
*/ */
int load_options = SFDO_ICON_THEME_LOAD_OPTIONS_DEFAULT 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_theme = sfdo_icon_theme_load(
sfdo->icon_ctx, sfdo->icon_ctx,
rc.icon_theme_name, load_options); 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);
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);
}
if (!sfdo->icon_theme) { if (!sfdo->icon_theme) {
goto err_icon_theme; goto err_icon_theme;
} }
@ -129,6 +148,10 @@ err_desktop_ctx:
err_basedir_ctx: err_basedir_ctx:
free(sfdo); free(sfdo);
wlr_log(WLR_ERROR, "Failed to initialize icon loader"); 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 void