+#include <stdio.h>
+
+/* static */
+
+static Client *
+nexttiled(Client *c) {
+ for(; c && (c->isfloat || !isvisible(c)); c = c->next);
+ return c;
+}
+
+static void
+togglemax(Client *c) {
+ XEvent ev;
+
+ if(c->isfixed)
+ return;
+
+ if((c->ismax = !c->ismax)) {
+ c->rx = c->x;
+ c->ry = c->y;
+ c->rw = c->w;
+ c->rh = c->h;
+ resize(c, wax, way, waw - 2 * BORDERPX, wah - 2 * BORDERPX, True);
+ }
+ else
+ resize(c, c->rx, c->ry, c->rw, c->rh, True);
+ while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
+}