+ c->next = clients;
+ clients = c;
+
+ XGrabButton(dpy, Button1, ControlMask, c->win, False, ButtonPressMask,
+ GrabModeAsync, GrabModeSync, None, None);
+ XGrabButton(dpy, Button1, MODKEY, c->win, False, ButtonPressMask,
+ GrabModeAsync, GrabModeSync, None, None);
+ XGrabButton(dpy, Button2, MODKEY, c->win, False, ButtonPressMask,
+ GrabModeAsync, GrabModeSync, None, None);
+ XGrabButton(dpy, Button3, MODKEY, c->win, False, ButtonPressMask,
+ GrabModeAsync, GrabModeSync, None, None);
+
+ if(!c->isfloat)
+ c->isfloat = trans || (c->maxw && c->minw &&
+ (c->maxw == c->minw) && (c->maxh == c->minh));
+
+
+ settitle(c);
+ arrange(NULL);
+
+ /* mapping the window now prevents flicker */
+ if(c->tags[tsel]) {
+ XMapRaised(dpy, c->win);
+ XMapRaised(dpy, c->title);
+ focus(c);
+ }
+ else {
+ XMapRaised(dpy, c->win);
+ XMapRaised(dpy, c->title);
+ }
+}
+
+void
+maximize(Arg *arg)
+{
+ if(!sel)
+ return;
+ sel->x = sx;
+ sel->y = sy + bh;
+ sel->w = sw - 2 * sel->border;
+ sel->h = sh - 2 * sel->border - bh;
+ higher(sel);
+ resize(sel, False, TopLeft);
+}
+
+void
+pop(Client *c)
+{
+ Client **l;
+ for(l = &clients; *l && *l != c; l = &(*l)->next);
+ *l = c->next;
+
+ c->next = clients; /* pop */
+ clients = c;
+ arrange(NULL);
+}
+
+void
+resize(Client *c, Bool inc, Corner sticky)
+{
+ XConfigureEvent e;
+ int right = c->x + c->w;
+ int bottom = c->y + c->h;
+
+ if(inc) {
+ if(c->incw)
+ c->w -= (c->w - c->basew) % c->incw;
+ if(c->inch)
+ c->h -= (c->h - c->baseh) % c->inch;
+ }
+ if(c->x > sw) /* might happen on restart */
+ c->x = sw - c->w;
+ if(c->y > sh)
+ c->y = sh - c->h;