theme: don't try to load "themerc"s if theme_name is NULL

theme_name is NULL when <theme><name></name>...</theme> is in rc.xml
This commit is contained in:
Tomi Ollila 2025-01-07 22:23:14 +02:00 committed by Hiroaki Yamamoto
parent 6496773fd1
commit 577c24306f

View file

@ -1496,15 +1496,18 @@ theme_init(struct theme *theme, struct server *server, const char *theme_name)
*/
theme_builtin(theme, server);
/*
* Read
* - <data-dir>/share/themes/$theme_name/labwc/themerc
* - <data-dir>/share/themes/$theme_name/openbox-3/themerc
*/
struct wl_list paths;
paths_theme_create(&paths, theme_name, "themerc");
theme_read(theme, &paths);
paths_destroy(&paths);
if (theme_name) {
/*
* Read
* - <data-dir>/share/themes/$theme_name/labwc/themerc
* - <data-dir>/share/themes/$theme_name/openbox-3/themerc
*/
paths_theme_create(&paths, theme_name, "themerc");
theme_read(theme, &paths);
paths_destroy(&paths);
}
/* Read <config-dir>/labwc/themerc-override */
paths_config_create(&paths, "themerc-override");