wmfs: Simplify scan function

This commit is contained in:
Martin Duquesnoy 2008-11-17 20:28:44 +01:00
parent b80ff52aff
commit b0d42cb605

View File

@ -172,23 +172,16 @@ void
scan(void) scan(void)
{ {
uint i, n; uint i, n;
Window usl, usl2, *w = NULL;
XWindowAttributes wa; XWindowAttributes wa;
Window usl, usl2, *w = NULL;
if(XQueryTree(dpy, root, &usl, &usl2, &w, &n)) if(XQueryTree(dpy, root, &usl, &usl2, &w, &n))
{ for(i = 0; i < n; ++i)
for(i = 0; i < n; i++) if(XGetWindowAttributes(dpy, w[i], &wa)
{ && !(wa.override_redirect || XGetTransientForHint(dpy, w[i], &usl))
if(!XGetWindowAttributes(dpy, w[i], &wa)) && wa.map_state == IsViewable)
continue;
if(wa.override_redirect || XGetTransientForHint(dpy, w[i], &usl))
continue;
if(wa.map_state == IsViewable)
client_manage(w[i], &wa); client_manage(w[i], &wa);
}
}
XFree(w); XFree(w);
arrange(); arrange();
return; return;