- for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
- n++;
- /* window geoms */
- mh = (n > nmaster) ? wah / nmaster : wah / (n > 0 ? n : 1);
- mw = (n > nmaster) ? (waw * master) / 1000 : waw;
- th = (n > nmaster) ? wah / (n - nmaster) : 0;
- tw = waw - mw;
-
- for(i = 0, c = clients; c; c = c->next)
- if(isvisible(c)) {
- if(c->isbanned)
- XMoveWindow(dpy, c->win, c->x, c->y);
- c->isbanned = False;
- if(c->swimming)
- continue;
- c->ismax = False;
- nx = wax;
- ny = way;
- if(i < nmaster) {
- ny += i * mh;
- nw = mw - 2 * BORDERPX;
- nh = mh - 2 * BORDERPX;
- }
- else { /* tile window */
- nx += mw;
- nw = tw - 2 * BORDERPX;
- if(th > 2 * BORDERPX) {
- ny += (i - nmaster) * th;
- nh = th - 2 * BORDERPX;
+ for(c = clients; c; c = c->next)
+ if(isvisible(c))
+ resize(c, c->x, c->y, c->w, c->h, True);
+}
+
+LAYOUTS
+
+/* extern */
+
+unsigned int blw = 0;
+
+void
+applyrules(Client *c) {
+ static char buf[512];
+ unsigned int i, j;
+ regmatch_t tmp;
+ Bool matched = False;
+ XClassHint ch = { 0 };
+
+ /* rule matching */
+ XGetClassHint(dpy, c->win, &ch);
+ snprintf(buf, sizeof buf, "%s:%s:%s",
+ ch.res_class ? ch.res_class : "",
+ ch.res_name ? ch.res_name : "", c->name);
+ for(i = 0; i < nrules; i++)
+ if(regs[i].propregex && !regexec(regs[i].propregex, buf, 1, &tmp, 0)) {
+ c->isfloating = rules[i].isfloating;
+ for(j = 0; regs[i].tagregex && j < ntags; j++) {
+ if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) {
+ matched = True;
+ c->tags[j] = True;