Xinqi Bao's Git
projects
/
dwm.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
applied Lukas' focus suggestion at startup, thanks
[dwm.git]
/
drw.c
diff --git
a/drw.c
b/drw.c
index
bc4ac41
..
b130405
100644
(file)
--- a/
drw.c
+++ b/
drw.c
@@
-157,7
+157,7
@@
drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, const char *tex
ty = y + (h / 2) - (th / 2) + drw->font->ascent;
tx = x + (h / 2);
/* shorten text if necessary */
ty = y + (h / 2) - (th / 2) + drw->font->ascent;
tx = x + (h / 2);
/* shorten text if necessary */
- for(len = MIN(olen, sizeof buf); len &&
tex.w > w - tex.h
; len--)
+ for(len = MIN(olen, sizeof buf); len &&
(tex.w > w - tex.h || w < tex.h)
; len--)
drw_font_getexts(drw->font, text, len, &tex);
if(!len)
return;
drw_font_getexts(drw->font, text, len, &tex);
if(!len)
return;