-tile(void) {
- unsigned int i, n, nx, ny, nw, nh, mw, th;
+tileresize(Client *c, int x, int y, int w, int h) {
+ resize(c, x, y, w, h, RESIZEHINTS);
+ if((RESIZEHINTS) && ((c->h < bh) || (c->h > h) || (c->w < bh) || (c->w > w)))
+ /* client doesn't accept size constraints */
+ resize(c, x, y, w, h, False);
+}
+
+void
+tileh(void) {
+ tilehstack(tilemaster());
+}
+
+void
+tilehstack(unsigned int n) {
+ int i, x, w;
+ Client *c;
+
+ if(n == 0)
+ return;
+
+ x = TX;
+ w = (TW) / n;
+ if(w < bh)
+ w = TW;
+
+ for(i = 0, c = nexttiled(clients); c; c = nexttiled(c->next), i++)
+ if(i > 0) {
+ if(i > 1 && i == n) /* remainder */
+ tileresize(c, x, TY, ((TX) + (TW)) - x - 2 * c->border,
+ TH - 2 * c->border);
+ else
+ tileresize(c, x, TY, w - 2 * c->border,
+ TH - 2 * c->border);
+ if(w != TW)
+ x = c->x + c->w + 2 * c->border;
+ }
+}
+
+unsigned int
+tilemaster(void) {
+ unsigned int n;