all repos — dwm @ c26e22cceeee5fdd40e6bd6e019729ed316e2e01

my dwm build

Gottox' drawtext simplification
Anselm R Garbe garbeam@gmail.com
Sun, 01 Jun 2008 11:58:19 +0100
commit

c26e22cceeee5fdd40e6bd6e019729ed316e2e01

parent

c2784e4a38f2305a444abaaf77f39219bd9f56e5

2 files changed, 3 insertions(+), 9 deletions(-)

jump to
M config.def.hconfig.def.h

@@ -24,7 +24,7 @@ };

/* layout(s) */ double mfact = 0.55; -Bool resizehints = True; /* False means respect size hints in tiled resizals */ +Bool resizehints = False; /* False means respect size hints in tiled resizals */ Layout layouts[] = { /* symbol arrange function */
M dwm.cdwm.c

@@ -571,14 +571,8 @@ /* shorten text if necessary */

for(; len && (w = textnw(buf, len)) > dc.w - h; len--); if(!len) return; - if(len < olen) { - if(len > 1) - buf[len - 1] = '.'; - if(len > 2) - buf[len - 2] = '.'; - if(len > 3) - buf[len - 3] = '.'; - } + if(len < olen) + strncpy(&buf[MAX(0, len - 3)], "...", len); XSetForeground(dpy, dc.gc, col[invert ? ColBG : ColFG]); if(dc.font.set) XmbDrawString(dpy, dc.drawable, dc.font.set, dc.gc, x, y, buf, len);