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)
{
uint i, n;
Window usl, usl2, *w = NULL;
XWindowAttributes wa;
Window usl, usl2, *w = NULL;
if(XQueryTree(dpy, root, &usl, &usl2, &w, &n))
{
for(i = 0; i < n; i++)
{
if(!XGetWindowAttributes(dpy, w[i], &wa))
continue;
if(wa.override_redirect || XGetTransientForHint(dpy, w[i], &usl))
continue;
if(wa.map_state == IsViewable)
for(i = 0; i < n; ++i)
if(XGetWindowAttributes(dpy, w[i], &wa)
&& !(wa.override_redirect || XGetTransientForHint(dpy, w[i], &usl))
&& wa.map_state == IsViewable)
client_manage(w[i], &wa);
}
}
XFree(w);
arrange();
return;