From ad76995af7e1bbae8ec81dd917def917453c379b Mon Sep 17 00:00:00 2001 From: okan Date: Sun, 2 Feb 2014 21:34:05 +0000 Subject: Move redundant window attr fetch from maprequest directly into client_init and perform that X roundtrip only once. --- xevents.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'xevents.c') diff --git a/xevents.c b/xevents.c index 89d7a63..06551e8 100644 --- a/xevents.c +++ b/xevents.c @@ -75,17 +75,14 @@ xev_handle_maprequest(XEvent *ee) { XMapRequestEvent *e = &ee->xmaprequest; struct client_ctx *cc = NULL, *old_cc; - XWindowAttributes xattr; if ((old_cc = client_current())) client_ptrsave(old_cc); - if ((cc = client_find(e->window)) == NULL) { - XGetWindowAttributes(X_Dpy, e->window, &xattr); - cc = client_init(e->window, screen_fromroot(xattr.root), 1); - } + if ((cc = client_find(e->window)) == NULL) + cc = client_init(e->window, NULL, 1); - if ((cc->flags & CLIENT_IGNORE) == 0) + if ((cc != NULL) && ((cc->flags & CLIENT_IGNORE) == 0)) client_ptrwarp(cc); } -- cgit 1.4.1