- XRaiseWindow(dpy, c->win);
- XRaiseWindow(dpy, c->title);
-}
-
-void
-lower(Client *c)
-{
- XLowerWindow(dpy, c->title);
- XLowerWindow(dpy, c->win);
-}
-
-void
-focus(Client *c)
-{
- if(csel && csel != c) {
- XSetWindowBorder(dpy, csel->win, dc.bg);
- XMapWindow(dpy, csel->title);
- draw_client(csel);
- }
- csel = c;
- XUnmapWindow(dpy, c->title);
- XSetWindowBorder(dpy, c->win, dc.fg);
- draw_client(c);
- XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
- XFlush(dpy);
- discard_events(EnterWindowMask);
-}
-
-void
-manage(Window w, XWindowAttributes *wa)
-{
- Client *c;
- XSetWindowAttributes twa;
-
- c = emallocz(sizeof(Client));
- c->win = w;
- c->tx = c->x = wa->x;
- c->ty = c->y = wa->y;
- c->tw = c->w = wa->width;
- c->h = wa->height;
- c->th = th;
- c->border = 1;
- update_size(c);
- XSelectInput(dpy, c->win,
- StructureNotifyMask | PropertyChangeMask | EnterWindowMask);
- XGetTransientForHint(dpy, c->win, &c->trans);
- twa.override_redirect = 1;
- twa.background_pixmap = ParentRelative;
- twa.event_mask = ExposureMask;
-
- c->tags[tsel] = tags[tsel];
- 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);
-
- update_name(c);