applied Martin Hurton's scan() patch with slight modifications

This commit is contained in:
Anselm R Garbe 2008-08-18 10:14:51 +01:00
parent 69c7b4b0ba
commit 6d7285fd6e

5
dwm.c
View file

@ -1246,10 +1246,9 @@ run(void) {
void void
scan(void) { scan(void) {
unsigned int i, num; 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)) { if(XQueryTree(dpy, root, &d1, &d2, &wins, &num)) {
for(i = 0; i < num; i++) { for(i = 0; i < num; i++) {
if(!XGetWindowAttributes(dpy, wins[i], &wa) if(!XGetWindowAttributes(dpy, wins[i], &wa)
@ -1265,10 +1264,10 @@ scan(void) {
&& (wa.map_state == IsViewable || getstate(wins[i]) == IconicState)) && (wa.map_state == IsViewable || getstate(wins[i]) == IconicState))
manage(wins[i], &wa); manage(wins[i], &wa);
} }
}
if(wins) if(wins)
XFree(wins); XFree(wins);
} }
}
void void
setclientstate(Client *c, long state) { setclientstate(Client *c, long state) {