mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
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.
This commit is contained in:
16
screen.c
16
screen.c
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user