Set at least one tag on screen where there is no one, use no screen option in [tag] sections in default config (= screen = -1, tag on each screen)

This commit is contained in:
Martin Duquesnoy
2012-01-20 23:23:45 +01:00
parent 545b1a2a7e
commit 682bbeea89
2 changed files with 19 additions and 9 deletions

View File

@@ -24,8 +24,8 @@ config_mouse_section(struct mbhead *mousebinds, struct conf_sec **sec)
{
m = xcalloc(1, sizeof(struct mousebind));
m->button = fetch_opt_first(sec[i], "1", "button").num;
m->func = uicb_name_func(fetch_opt_first(sec[i], "", "func").str);
m->button = fetch_opt_first(sec[i], "1", "button").num;
m->func = uicb_name_func(fetch_opt_first(sec[i], "", "func").str);
if((p = fetch_opt_first(sec[i], "", "cmd").str))
m->cmd = xstrdup(p);
@@ -161,6 +161,11 @@ config_tag(void)
tag_new(s, name);
}
/* If no tag at all on a screen, add one anyway */
SLIST_FOREACH(s, &W->h.screen, next)
if(TAILQ_EMPTY(&s->tags))
tag_new(s, "tag");
free(ks);
}