diff options
Diffstat (limited to '')
| -rw-r--r-- | dwm.c | 16 |
1 files changed, 12 insertions, 4 deletions
| @@ -210,7 +210,7 @@ void zoom(const char *arg); | |||
| 210 | char stext[256], buf[256]; | 210 | char stext[256], buf[256]; |
| 211 | int screen, sx, sy, sw, sh; | 211 | int screen, sx, sy, sw, sh; |
| 212 | int (*xerrorxlib)(Display *, XErrorEvent *); | 212 | int (*xerrorxlib)(Display *, XErrorEvent *); |
| 213 | int bx, by, bw, bh, blw, mx, my, mw, mh, mox, moy, mow, moh, tx, ty, tw, th, wx, wy, ww, wh; | 213 | int bx, by, bw, bh, blw, bgw, mx, my, mw, mh, mox, moy, mow, moh, tx, ty, tw, th, wx, wy, ww, wh; |
| 214 | unsigned int numlockmask = 0; | 214 | unsigned int numlockmask = 0; |
| 215 | void (*handler[LASTEvent]) (XEvent *) = { | 215 | void (*handler[LASTEvent]) (XEvent *) = { |
| 216 | [ButtonPress] = buttonpress, | 216 | [ButtonPress] = buttonpress, |
| @@ -322,10 +322,10 @@ buttonpress(XEvent *e) { | |||
| 322 | XButtonPressedEvent *ev = &e->xbutton; | 322 | XButtonPressedEvent *ev = &e->xbutton; |
| 323 | 323 | ||
| 324 | if(ev->window == barwin) { | 324 | if(ev->window == barwin) { |
| 325 | x = 0; | 325 | x = bgw; |
| 326 | for(i = 0; i < LENGTH(tags); i++) { | 326 | for(i = 0; i < LENGTH(tags); i++) { |
| 327 | x += textw(tags[i]); | 327 | x += textw(tags[i]); |
| 328 | if(ev->x < x) { | 328 | if(ev->x > bgw && ev->x < x) { |
| 329 | if(ev->button == Button1) { | 329 | if(ev->button == Button1) { |
| 330 | if(ev->state & MODKEY) | 330 | if(ev->state & MODKEY) |
| 331 | tag(tags[i]); | 331 | tag(tags[i]); |
| @@ -514,6 +514,9 @@ drawbar(void) { | |||
| 514 | Client *c; | 514 | Client *c; |
| 515 | 515 | ||
| 516 | dc.x = 0; | 516 | dc.x = 0; |
| 517 | dc.w = bgw; | ||
| 518 | drawtext(geom->symbol, dc.norm, False); | ||
| 519 | dc.x += bgw; | ||
| 517 | for(c = stack; c && !isvisible(c); c = c->snext); | 520 | for(c = stack; c && !isvisible(c); c = c->snext); |
| 518 | for(i = 0; i < LENGTH(tags); i++) { | 521 | for(i = 0; i < LENGTH(tags); i++) { |
| 519 | dc.w = textw(tags[i]); | 522 | dc.w = textw(tags[i]); |
| @@ -854,7 +857,7 @@ unsigned int | |||
| 854 | idxoftag(const char *t) { | 857 | idxoftag(const char *t) { |
| 855 | unsigned int i; | 858 | unsigned int i; |
| 856 | 859 | ||
| 857 | for(i = 0; (i < LENGTH(tags)) && (tags[i] != t); i++); | 860 | for(i = 0; (i < LENGTH(tags)) && strcmp(tags[i], t); i++); |
| 858 | return (i < LENGTH(tags)) ? i : 0; | 861 | return (i < LENGTH(tags)) ? i : 0; |
| 859 | } | 862 | } |
| 860 | 863 | ||
| @@ -1501,6 +1504,11 @@ setup(void) { | |||
| 1501 | if(i > blw) | 1504 | if(i > blw) |
| 1502 | blw = i; | 1505 | blw = i; |
| 1503 | } | 1506 | } |
| 1507 | for(bgw = i = 0; i < LENGTH(geoms); i++) { | ||
| 1508 | i = textw(geoms[i].symbol); | ||
| 1509 | if(i > bgw) | ||
| 1510 | bgw = i; | ||
| 1511 | } | ||
| 1504 | 1512 | ||
| 1505 | wa.override_redirect = 1; | 1513 | wa.override_redirect = 1; |
| 1506 | wa.background_pixmap = ParentRelative; | 1514 | wa.background_pixmap = ParentRelative; |
