mouse button press on the statusbar causes segfault

The tags member of screen is no longer an array but a linked list, thus
tags[0] (used in config.c) is ok since tags points to the first tag
struct, but tags[i], i>0 is wrong. There is one such use in
handle_event_buttonpress, causing awesome to segfault when pressing with
the mouse on the statusbar. The attached patch fixes this.
This commit is contained in:
Nikos Ntarmos 2007-12-17 07:35:08 +01:00 committed by Julien Danjou
parent 2990514863
commit 395c0ba6d7
1 changed files with 1 additions and 1 deletions

View File

@ -75,7 +75,7 @@ handle_event_buttonpress(XEvent * e)
{
for(i = 1, tag = globalconf.screens[screen].tags; tag; tag = tag->next, i++)
{
x += textwidth_primitive(e->xany.display, globalconf.screens[screen].font, globalconf.screens[screen].tags[i].name);
x += textwidth_primitive(e->xany.display, globalconf.screens[screen].font, tag->name);
if(((globalconf.screens[screen].statusbar.position == BarTop
|| globalconf.screens[screen].statusbar.position == BarBot)
&& ev->x < x)