Fix possible segfault when no [selbar] in config

This commit is contained in:
Philippe Pepiot 2010-04-15 01:09:22 +02:00
parent 891760bfac
commit c8bb465bb0
3 changed files with 1 additions and 3 deletions

View File

@ -1186,7 +1186,6 @@ uicb_clientlist(uicb_t cmd)
int n = 0;
Window w;
Client *c = NULL;
Bool is_sel;
for(c = clients; c; c = c->next)
if(c->tag == seltag[selscreen] && c->screen == selscreen)

View File

@ -176,7 +176,6 @@ conf_bar_section(void)
conf.bars.height = fetch_opt_first(bar, "-1", "height").num;
conf.colors.bar = getcolor(fetch_opt_first(bar, "#000000", "bg").str);
conf.colors.text = fetch_opt_first(bar, "#ffffff", "fg").str;
conf.bars.selbar = fetch_opt_first(bar, "false", "selbar").bool;
mouse = fetch_section(bar, "mouse");

View File

@ -99,7 +99,7 @@ buttonpress(XButtonEvent *ev)
conf.bars.mouse[j].func(conf.bars.mouse[j].cmd);
/* Selbar */
if(ev->window == infobar[selscreen].selbar->win)
if(conf.bars.selbar && ev->window == infobar[selscreen].selbar->win)
for(i = 0; i < conf.selbar.nmouse; ++i)
if(conf.selbar.mouse[i].tag == seltag[conf.selbar.mouse[i].screen]
|| conf.selbar.mouse[i].tag < 0)