add support for right/left statusbar position and clicks

This commit is contained in:
Julien Danjou 2008-01-04 13:04:34 +01:00
parent e3de02d2ce
commit 65fe4e8933
1 changed files with 16 additions and 11 deletions

View File

@ -150,10 +150,14 @@ tasklist_button_press(Widget *widget, XButtonPressedEvent *ev)
box_width = widget->width / n;
if(ev->button == Button1 && CLEANMASK(ev->state) == NoSymbol)
{
if(widget->statusbar->position == BarTop
|| widget->statusbar->position == BarBot)
{
ci = (ev->x - widget->location) / box_width;
else if(widget->statusbar->position == BarRight)
ci = (ev->y - widget->location) / box_width;
else
ci = ((widget->statusbar->width - ev->y) - widget->location) / box_width;
/* found first visible client */
for(c = globalconf.clients;
@ -165,6 +169,7 @@ tasklist_button_press(Widget *widget, XButtonPressedEvent *ev)
i++;
focus(c, True, widget->statusbar->screen);
return;
}
}