From c4e6bde74ca5d5e9e344ee486dd3a3b58b37fc77 Mon Sep 17 00:00:00 2001 From: Johan Malm Date: Wed, 25 Sep 2024 22:06:01 +0100 Subject: [PATCH] theme: start openbox/cursor themes with empty entries ...to avoid forcing a theme if the user prefers to just stick with defaults. --- src/theme.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/theme.c b/src/theme.c index a18f93c..b810bbc 100644 --- a/src/theme.c +++ b/src/theme.c @@ -182,6 +182,15 @@ static struct { void theme_find(struct themes *themes, const char *middle, const char *end) { + struct theme *theme = NULL; + + /* + * Always start with an empty entry to allow users to set it to nothing + * to use default values. + */ + theme = grow_vector_by_one_theme(themes); + theme->name = strdup(""); + char path[4096]; for (uint32_t i = 0; i < ARRAY_SIZE(dirs); ++i) { if (dirs[i].prefix) { @@ -217,7 +226,7 @@ theme_find(struct themes *themes, const char *middle, const char *end) * theme dir exists. In this case we add it manually. */ if (!vector_contains(themes, "Adwaita")) { - struct theme *theme = grow_vector_by_one_theme(themes); + theme = grow_vector_by_one_theme(themes); theme->name = strdup("Adwaita"); theme->path = NULL; }