X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=event.c;h=e452167460a59d7c1034bac80a705725e784b1d1;hb=292ccc4c43d9529cb6db0973fcab6e24c73607a5;hp=53a110a6d48d49c884bb69c7c2ab555808039681;hpb=8278f0a6befccfb4eb156cb312c69e032158734a;p=dwm.git diff --git a/event.c b/event.c index 53a110a..e452167 100644 --- a/event.c +++ b/event.c @@ -103,19 +103,22 @@ buttonpress(XEvent *e) if(barwin == ev->window) { switch(ev->button) { - case Button1: + default: x = 0; for(a.i = 0; a.i < ntags; a.i++) { x += textw(tags[a.i]); if(ev->x < x) { - view(&a); + if(ev->button == Button3) + viewextend(&a); + else + view(&a); return; } } - focusprev(NULL); - break; - case Button3: - focusnext(NULL); + if(ev->button == Button1) + viewprev(&a); + else if(ev->button == Button3) + viewnext(&a); break; case Button4: viewprev(&a);