X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=event.c;h=35cd4f9e1958208fd20c9ef3d9448061efe603c8;hb=d37dfa1bedbfadb5d39aa1937e77d4fd44319018;hp=c2288f4c94d763709a3fc898995b4016f6691bf8;hpb=2272df9d3179ec639066614f4d36d18df16ff725;p=dwm.git diff --git a/event.c b/event.c index c2288f4..35cd4f9 100644 --- a/event.c +++ b/event.c @@ -105,15 +105,19 @@ buttonpress(XEvent *e) XButtonPressedEvent *ev = &e->xbutton; if(barwin == ev->window) { - x = 0; - for(a.i = 0; a.i < ntags; a.i++) { - x += textw(tags[a.i]); - if(ev->x < x) { - if(ev->button == Button1) - view(&a); - else if(ev->button == Button3) - toggleview(&a); - return; + if(ev->x < modew) + togglemode(NULL); + else { + x = modew; + for(a.i = 0; a.i < ntags; a.i++) { + x += textw(tags[a.i]); + if(ev->x < x) { + if(ev->button == Button1) + view(&a); + else if(ev->button == Button3) + toggleview(&a); + return; + } } } }