X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=bar.c;h=ea4b946bb69682b9748573fedd96a45fc1a73558;hp=9914e5658cb9b1231bc7810fafb2b8ffce70eae3;hb=6458d72572a30d2cc4af3385755033b2cca93057;hpb=9cd686c93a80b4095d4ee0960bef320ccd9ea02c diff --git a/bar.c b/bar.c index 9914e56..ea4b946 100644 --- a/bar.c +++ b/bar.c @@ -6,6 +6,20 @@ #include "dwm.h" void +barclick(XButtonPressedEvent *e) +{ + int x = 0; + Arg a; + for(a.i = 0; a.i < TLast; a.i++) { + x += textw(tags[a.i]) + dc.font.height; + if(e->x < x) { + view(&a); + return; + } + } +} + +void draw_bar() { int i;