+#include <stdio.h>
+
+/* static */
+
+static Client *
+nexttiled(Client *c) {
+ for(c = getnext(c); c && c->isfloat; c = getnext(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->x = wax;
+ c->ry = c->y; c->y = way;
+ c->rw = c->w; c->w = waw - 2 * BORDERPX;
+ c->rh = c->h; c->h = wah - 2 * BORDERPX;
+ }
+ else {
+ c->x = c->rx;
+ c->y = c->ry;
+ c->w = c->rw;
+ c->h = c->rh;
+ }
+ resize(c, True, TopLeft);
+ while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
+}