Skip to content

Commit c4e6bde

Browse files
committed
theme: start openbox/cursor themes with empty entries
...to avoid forcing a theme if the user prefers to just stick with defaults.
1 parent 98fb0c0 commit c4e6bde

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Diff for: src/theme.c

+10-1
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,15 @@ static struct {
182182
void
183183
theme_find(struct themes *themes, const char *middle, const char *end)
184184
{
185+
struct theme *theme = NULL;
186+
187+
/*
188+
* Always start with an empty entry to allow users to set it to nothing
189+
* to use default values.
190+
*/
191+
theme = grow_vector_by_one_theme(themes);
192+
theme->name = strdup("");
193+
185194
char path[4096];
186195
for (uint32_t i = 0; i < ARRAY_SIZE(dirs); ++i) {
187196
if (dirs[i].prefix) {
@@ -217,7 +226,7 @@ theme_find(struct themes *themes, const char *middle, const char *end)
217226
* theme dir exists. In this case we add it manually.
218227
*/
219228
if (!vector_contains(themes, "Adwaita")) {
220-
struct theme *theme = grow_vector_by_one_theme(themes);
229+
theme = grow_vector_by_one_theme(themes);
221230
theme->name = strdup("Adwaita");
222231
theme->path = NULL;
223232
}

0 commit comments

Comments
 (0)