Skip to content

Commit

Permalink
theme: start openbox/cursor themes with empty entries
Browse files Browse the repository at this point in the history
...to avoid forcing a theme if the user prefers to just stick with
defaults.
  • Loading branch information
johanmalm committed Sep 25, 2024
1 parent 98fb0c0 commit c4e6bde
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/theme.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit c4e6bde

Please sign in to comment.