+ XLowerWindow(dpy, c->title);
+ XLowerWindow(dpy, c->win);
+}
+
+void
+manage(Window w, XWindowAttributes *wa)
+{
+ Client *c;
+ Window trans;
+ XSetWindowAttributes twa;
+
+ c = emallocz(sizeof(Client));
+ c->tags = emallocz(ntags * sizeof(Bool));
+ c->win = w;
+ c->x = c->tx = wa->x;
+ c->y = c->ty = wa->y;
+ c->w = c->tw = wa->width;
+ c->h = wa->height;
+ c->th = bh;
+
+ c->border = 0;
+ setsize(c);
+
+ if(c->h != sh && c->y < bh)
+ c->y = c->ty = bh;
+
+ c->proto = getproto(c->win);
+ XSelectInput(dpy, c->win,
+ StructureNotifyMask | PropertyChangeMask | EnterWindowMask);
+ XGetTransientForHint(dpy, c->win, &trans);
+ twa.override_redirect = 1;
+ twa.background_pixmap = ParentRelative;
+ twa.event_mask = ExposureMask | EnterWindowMask;
+
+ c->title = XCreateWindow(dpy, root, c->tx, c->ty, c->tw, c->th,
+ 0, DefaultDepth(dpy, screen), CopyFromParent,
+ DefaultVisual(dpy, screen),
+ CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa);