aboutsummaryrefslogtreecommitdiffstats
path: root/screen.c
diff options
context:
space:
mode:
authorokan2014-02-03 20:20:39 +0000
committerokan2014-02-03 20:20:39 +0000
commit0591be5c2b59055e9d6b193f634e9bc16bd1e999 (patch)
tree403655c8534ddc003bbe2b6d16085ddc2a91471e /screen.c
parentf21abfc55cc09949eb90c5fa93a629d04b204a6a (diff)
downloadcwm-0591be5c2b59055e9d6b193f634e9bc16bd1e999.tar.gz
Move redundant bits from screen_init (while dealing with existing
clients) directly into client_init, performing the X roundtrip only once. With the previous change in maprequest, this moves decision making into one place for creating new clients.
Diffstat (limited to '')
-rw-r--r--screen.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/screen.c b/screen.c
index 37cb5c3..735ff84 100644
--- a/screen.c
+++ b/screen.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: screen.c,v 1.57 2014/02/02 16:29:04 okan Exp $
+ * $OpenBSD: screen.c,v 1.58 2014/02/03 20:20:39 okan Exp $
*/
#include <sys/param.h>
@@ -35,7 +35,6 @@ screen_init(int which)
{
struct screen_ctx *sc;
Window *wins, w0, w1;
- XWindowAttributes winattr;
XSetWindowAttributes rootattr;
unsigned int nwins, i;
@@ -62,17 +61,12 @@ screen_init(int which)
CWEventMask|CWCursor, &rootattr);
/* Deal with existing clients. */
- XQueryTree(X_Dpy, sc->rootwin, &w0, &w1, &wins, &nwins);
- for (i = 0; i < nwins; i++) {
- XGetWindowAttributes(X_Dpy, wins[i], &winattr);
- if (winattr.override_redirect ||
- winattr.map_state != IsViewable)
- continue;
- (void)client_init(wins[i], sc, winattr.map_state != IsUnmapped);
- }
- if (wins)
- XFree(wins);
+ if (XQueryTree(X_Dpy, sc->rootwin, &w0, &w1, &wins, &nwins)) {
+ for (i = 0; i < nwins; i++)
+ (void)client_init(wins[i], sc);
+ XFree(wins);
+ }
screen_updatestackingorder(sc);
if (HasRandr)