aboutsummaryrefslogtreecommitdiffstats
path: root/xevents.c
diff options
context:
space:
mode:
authorokan2014-02-02 21:34:05 +0000
committerokan2014-02-02 21:34:05 +0000
commitf21abfc55cc09949eb90c5fa93a629d04b204a6a (patch)
tree4fe82e798f855bbd1d066917a872a56547c9ddbc /xevents.c
parentb803e99634ca48acb240a6e5a67ab768a72159bc (diff)
downloadcwm-f21abfc55cc09949eb90c5fa93a629d04b204a6a.tar.gz
Move redundant window attr fetch from maprequest directly into
client_init and perform that X roundtrip only once.
Diffstat (limited to 'xevents.c')
-rw-r--r--xevents.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/xevents.c b/xevents.c
index f2b520f..82dfedd 100644
--- a/xevents.c
+++ b/xevents.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: xevents.c,v 1.109 2014/01/30 15:41:11 okan Exp $
+ * $OpenBSD: xevents.c,v 1.110 2014/02/02 21:34:05 okan Exp $
*/
/*
@@ -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);
}