mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
Move redundant window attr fetch from maprequest directly into
client_init and perform that X roundtrip only once.
This commit is contained in:
5
client.c
5
client.c
@@ -63,6 +63,10 @@ client_init(Window win, struct screen_ctx *sc, int mapped)
|
||||
|
||||
if (win == None)
|
||||
return (NULL);
|
||||
if (!XGetWindowAttributes(X_Dpy, win, &wattr))
|
||||
return (NULL);
|
||||
if (sc == NULL)
|
||||
sc = screen_fromroot(wattr.root);
|
||||
|
||||
cc = xcalloc(1, sizeof(*cc));
|
||||
|
||||
@@ -86,7 +90,6 @@ client_init(Window win, struct screen_ctx *sc, int mapped)
|
||||
cc->ptr.x = -1;
|
||||
cc->ptr.y = -1;
|
||||
|
||||
XGetWindowAttributes(X_Dpy, cc->win, &wattr);
|
||||
cc->geom.x = wattr.x;
|
||||
cc->geom.y = wattr.y;
|
||||
cc->geom.w = wattr.width;
|
||||
|
||||
Reference in New Issue
Block a user