From b0d42cb60521144bee3684964be20f5eb05d69fb Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Mon, 17 Nov 2008 20:28:44 +0100 Subject: [PATCH] wmfs: Simplify scan function --- src/wmfs.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/wmfs.c b/src/wmfs.c index 75a851b..2a0cb59 100644 --- a/src/wmfs.c +++ b/src/wmfs.c @@ -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;