]> git.mdlowis.com Git - proto/labwc.git/commitdiff
theme: don't try to load "themerc"s if theme_name is NULL
authorTomi Ollila <tomi.ollila@iki.fi>
Tue, 7 Jan 2025 20:23:14 +0000 (22:23 +0200)
committerHiroaki Yamamoto <hrak1529@gmail.com>
Sun, 12 Jan 2025 05:55:04 +0000 (14:55 +0900)
theme_name is NULL when <theme><name></name>...</theme> is in rc.xml

src/theme.c

index e087b6626ae722c6758ee474bcf326c9af5a6215..b0ebdf5fd748433312cab6a6189a0008e896fa9b 100644 (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");