Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
dwm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
abc...
[dwm.git]
/
dwm.c
diff --git
a/dwm.c
b/dwm.c
index
d903e9a
..
14cf3f9
100644
(file)
--- a/
dwm.c
+++ b/
dwm.c
@@
-568,9
+568,9
@@
drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]) {
void
drawtext(const char *text, unsigned long col[ColLast], Bool invert) {
void
drawtext(const char *text, unsigned long col[ColLast], Bool invert) {
+ char buf[256];
int i, x, y, h, len, olen;
XRectangle r = { dc.x, dc.y, dc.w, dc.h };
int i, x, y, h, len, olen;
XRectangle r = { dc.x, dc.y, dc.w, dc.h };
- char buf[256];
XSetForeground(dpy, dc.gc, col[invert ? ColFG : ColBG]);
XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
XSetForeground(dpy, dc.gc, col[invert ? ColFG : ColBG]);
XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
@@
-581,7
+581,7
@@
drawtext(const char *text, unsigned long col[ColLast], Bool invert) {
y = dc.y + (dc.h / 2) - (h / 2) + dc.font.ascent;
x = dc.x + (h / 2);
/* shorten text if necessary */
y = dc.y + (dc.h / 2) - (h / 2) + dc.font.ascent;
x = dc.x + (h / 2);
/* shorten text if necessary */
- for(len = MIN(olen, sizeof buf); len && (i = textnw(buf, len)) > dc.w - h; len--);
+ for(len = MIN(olen, sizeof buf); len && textnw(buf, len) > dc.w - h; len--);
if(!len)
return;
memcpy(buf, text, len);
if(!len)
return;
memcpy(buf, text, len);
@@
-1246,10
+1246,9
@@
run(void) {
void
scan(void) {
unsigned int i, num;
void
scan(void) {
unsigned int i, num;
- Window *wins, d1, d2;
+ Window d1, d2, *wins = NULL;
XWindowAttributes wa;
XWindowAttributes wa;
- wins = NULL;
if(XQueryTree(dpy, root, &d1, &d2, &wins, &num)) {
for(i = 0; i < num; i++) {
if(!XGetWindowAttributes(dpy, wins[i], &wa)
if(XQueryTree(dpy, root, &d1, &d2, &wins, &num)) {
for(i = 0; i < num; i++) {
if(!XGetWindowAttributes(dpy, wins[i], &wa)
@@
-1265,9
+1264,9
@@
scan(void) {
&& (wa.map_state == IsViewable || getstate(wins[i]) == IconicState))
manage(wins[i], &wa);
}
&& (wa.map_state == IsViewable || getstate(wins[i]) == IconicState))
manage(wins[i], &wa);
}
+ if(wins)
+ XFree(wins);
}
}
- if(wins)
- XFree(wins);
}
void
}
void