add support for right/left statusbar position and clicks
This commit is contained in:
parent
e3de02d2ce
commit
65fe4e8933
|
@ -150,22 +150,27 @@ tasklist_button_press(Widget *widget, XButtonPressedEvent *ev)
|
||||||
box_width = widget->width / n;
|
box_width = widget->width / n;
|
||||||
|
|
||||||
if(ev->button == Button1 && CLEANMASK(ev->state) == NoSymbol)
|
if(ev->button == Button1 && CLEANMASK(ev->state) == NoSymbol)
|
||||||
|
{
|
||||||
if(widget->statusbar->position == BarTop
|
if(widget->statusbar->position == BarTop
|
||||||
|| widget->statusbar->position == BarBot)
|
|| widget->statusbar->position == BarBot)
|
||||||
{
|
|
||||||
ci = (ev->x - widget->location) / box_width;
|
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 */
|
/* found first visible client */
|
||||||
for(c = globalconf.clients;
|
for(c = globalconf.clients;
|
||||||
c && !ISVISIBLE_ON_TB(c, widget->statusbar->screen);
|
c && !ISVISIBLE_ON_TB(c, widget->statusbar->screen);
|
||||||
c = c->next);
|
c = c->next);
|
||||||
/* found ci-th visible client */
|
/* found ci-th visible client */
|
||||||
for(; c && i < ci; c = c->next)
|
for(; c && i < ci; c = c->next)
|
||||||
if(ISVISIBLE_ON_TB(c, widget->statusbar->screen))
|
if(ISVISIBLE_ON_TB(c, widget->statusbar->screen))
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
focus(c, True, widget->statusbar->screen);
|
focus(c, True, widget->statusbar->screen);
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(b = widget->buttons; b; b = b->next)
|
for(b = widget->buttons; b; b = b->next)
|
||||||
|
|
Loading…
Reference in New Issue