sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit b286aad12c2298529e9a34b16ebf4e8ba9c02a6c
parent 979adac912242b0e8a5f59cb972b323a5d2ca1e6
Author: Charles Svitlik <staticsunn@gmail.com>
Date:   Sun, 30 Sep 2012 17:12:04 -0400

Update fancybar patch to hg revision c794a9f5ae5e.
Diffstat:
Adwm.suckless.org/patches/fancybar-c794a9f5ae5e.patch | 124+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mdwm.suckless.org/patches/fancybar.md | 1+
2 files changed, 125 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/fancybar-c794a9f5ae5e.patch b/dwm.suckless.org/patches/fancybar-c794a9f5ae5e.patch @@ -0,0 +1,124 @@ +--- dwm.c.orig 2012-09-30 16:19:00.251353990 -0400 ++++ dwm.c 2012-09-30 16:18:06.436026937 -0400 +@@ -179,6 +179,7 @@ + static Monitor *dirtomon(int dir); + static void drawbar(Monitor *m); + static void drawbars(void); ++static void drawline(unsigned long col[ColLast]); + static void drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]); + static void drawtext(const char *text, unsigned long col[ColLast], Bool invert); + static void enternotify(XEvent *e); +@@ -721,12 +722,15 @@ + + void + drawbar(Monitor *m) { +- int x; +- unsigned int i, occ = 0, urg = 0; ++ int x, ow, mw = 0, extra, tw; ++ unsigned int i, n = 0, occ = 0, urg = 0; + unsigned long *col; +- Client *c; ++ Client *c, *firstvis, *lastvis = NULL; ++ DC seldc; + + for(c = m->clients; c; c = c->next) { ++ if(ISVISIBLE(c)) ++ n++; + occ |= c->tags; + if(c->isurgent) + urg |= c->tags; +@@ -755,16 +759,61 @@ + } + else + dc.x = m->ww; +- if((dc.w = dc.x - x) > bh) { +- dc.x = x; +- if(m->sel) { +- col = m == selmon ? dc.sel : dc.norm; +- drawtext(m->sel->name, col, False); +- drawsquare(m->sel->isfixed, m->sel->isfloating, False, col); ++ for(c = m->clients; c && !ISVISIBLE(c); c = c->next); ++ firstvis = c; ++ ++ col = m == selmon ? dc.sel : dc.norm; ++ dc.w = dc.x - x; ++ dc.x = x; ++ ++ if(n > 0) { ++ mw = dc.w / n; ++ extra = 0; ++ seldc = dc; ++ i = 0; ++ ++ while(c) { ++ lastvis = c; ++ tw = TEXTW(c->name); ++ if(tw < mw) extra += (mw - tw); else i++; ++ for(c = c->next; c && !ISVISIBLE(c); c = c->next); + } +- else ++ ++ if(i > 0) mw += extra / i; ++ ++ c = firstvis; ++ x = dc.x; ++ } ++ ++ while(dc.w > bh) { ++ if(c) { ++ ow = dc.w; ++ tw = TEXTW(c->name); ++ dc.w = MIN(ow, tw); ++ ++ if(dc.w > mw) dc.w = mw; ++ if(m->sel ==c) seldc = dc; ++ if(c == lastvis) dc.w = ow; ++ ++ drawtext(c->name, col, False); ++ if(c != firstvis) drawline(col); ++ drawsquare(c->isfixed, c->isfloating, False, col); ++ ++ dc.x += dc.w; ++ dc.w = ow - dc.w; ++ for(c = c->next; c&& !ISVISIBLE(c); c = c->next); ++ } else { + drawtext(NULL, dc.norm, False); ++ break; ++ } + } ++ ++ if(m == selmon && m->sel && ISVISIBLE(m->sel)) { ++ dc = seldc; ++ drawtext(m->sel->name, col, True); ++ drawsquare(m->sel->isfixed, m->sel->isfloating, True, col); ++ } ++ + XCopyArea(dpy, dc.drawable, m->barwin, dc.gc, 0, 0, m->ww, bh, 0, 0); + XSync(dpy, False); + } +@@ -778,6 +827,15 @@ + } + + void ++drawline(unsigned long col[ColLast]) { ++ XGCValues gcv; ++ ++ gcv.foreground = col[ColFG]; ++ XChangeGC(dpy, dc.gc, GCForeground, &gcv); ++ XDrawLine(dpy, dc.drawable, dc.gc, dc.x, dc.y, dc.x, dc.y + (dc.font.ascent + dc.font.descent + 2)); ++} ++ ++void + drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]) { + int x; + +@@ -1327,8 +1385,7 @@ + } + if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { + updatetitle(c); +- if(c == c->mon->sel) +- drawbar(c->mon); ++ drawbar(c->mon); + } + if(ev->atom == netatom[NetWMWindowType]) + updatewindowtype(c); diff --git a/dwm.suckless.org/patches/fancybar.md b/dwm.suckless.org/patches/fancybar.md @@ -14,6 +14,7 @@ fit, they're cropped. The title of the selected window is inverted. * [fancybar-5.6.1.diff](historical/fancybar-5.6.1.diff) (dwm 5.6.1) (20090824) * [fancybar-r1496.diff](fancybar-r1496.diff) (dwm 5.7) (20090922) + * [fancybar-c794a9f5ae5e.patch](fancybar-c794a9f5ae5e.patch) (hg rev c794a9f5ae5e) (20120708) ## Author