From 8a6dd51fac7632b413dd36c08d725ab28b161797 Mon Sep 17 00:00:00 2001 From: okan Date: Mon, 3 Feb 2014 20:29:05 +0000 Subject: make this XQueryTree like the other --- screen.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'screen.c') diff --git a/screen.c b/screen.c index a9c051d..0bcdeec 100644 --- a/screen.c +++ b/screen.c @@ -97,19 +97,17 @@ screen_updatestackingorder(struct screen_ctx *sc) struct client_ctx *cc; unsigned int nwins, i, s; - if (!XQueryTree(X_Dpy, sc->rootwin, &w0, &w1, &wins, &nwins)) - return; - - for (s = 0, i = 0; i < nwins; i++) { - /* Skip hidden windows */ - if ((cc = client_find(wins[i])) == NULL || - cc->flags & CLIENT_HIDDEN) - continue; - - cc->stackingorder = s++; + if (XQueryTree(X_Dpy, sc->rootwin, &w0, &w1, &wins, &nwins)) { + for (s = 0, i = 0; i < nwins; i++) { + /* Skip hidden windows */ + if ((cc = client_find(wins[i])) == NULL || + cc->flags & CLIENT_HIDDEN) + continue; + + cc->stackingorder = s++; + } + XFree(wins); } - - XFree(wins); } /* -- cgit 1.4.1