X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=dwm.c;h=07d0d36f4c744a032029a4dde17f368bfefb1bf9;hb=565050ac51687bbd4f388c6aeb2298db94430efb;hp=d448f5b472b794e9ab4e39d8efca723b46a7be99;hpb=3e6fe6b541bcc553e2e104a8117008af02a8c760;p=dwm.git diff --git a/dwm.c b/dwm.c index d448f5b..07d0d36 100644 --- a/dwm.c +++ b/dwm.c @@ -66,7 +66,7 @@ typedef union { int i; unsigned int ui; float f; - void *v; + const void *v; } Arg; typedef struct { @@ -123,7 +123,7 @@ typedef struct { struct Monitor { int screen_number; float mfact; - int by, btx; /* bar geometry */ + int by; /* bar geometry */ int mx, my, mw, mh; /* screen size */ int wx, wy, ww, wh; /* window area */ unsigned int seltags; @@ -136,7 +136,7 @@ struct Monitor { Client *stack; Monitor *next; Window barwin; - Layout *lt[2]; + const Layout *lt[2]; }; typedef struct { @@ -275,7 +275,7 @@ struct NumTags { char limitexceeded[sizeof(unsigned int) * 8 < LENGTH(tags) ? -1 void applyrules(Client *c) { unsigned int i; - Rule *r; + const Rule *r; XClassHint ch = { 0 }; /* rule matching */ @@ -409,9 +409,8 @@ buttonpress(XEvent *e) { selmon = m; focus(NULL); } - if(ev->window == selmon->barwin && ev->x >= selmon->btx) { - i = 0; - x = selmon->btx; + if(ev->window == selmon->barwin) { + i = x = 0; do x += TEXTW(tags[i]); while(ev->x >= x && ++i < LENGTH(tags)); @@ -652,12 +651,6 @@ drawbar(Monitor *m) { urg |= c->tags; } dc.x = 0; - if(mons->next) { /* more than a single monitor */ - dc.w = TEXTW(monsyms[m->screen_number]); - drawtext(monsyms[m->screen_number], selmon == m ? dc.sel : dc.norm, False); - dc.x += dc.w; - } - m->btx = dc.x; for(i = 0; i < LENGTH(tags); i++) { dc.w = TEXTW(tags[i]); col = m->tagset[m->seltags] & 1 << i ? dc.sel : dc.norm; @@ -1726,8 +1719,8 @@ updategeom(void) { m->sellt = 0; m->tagset[0] = m->tagset[1] = 1; m->mfact = mfact; - m->showbar = SHOWBAR; - m->topbar = TOPBAR; + m->showbar = showbar; + m->topbar = topbar; m->lt[0] = &layouts[0]; m->lt[1] = &layouts[1 % LENGTH(layouts)]; updatebarpos(m);