+jason_layout(Monitor *m) {
+ unsigned int i, tiled_count, mw, right_width, tabs_count, cur_tab;
+ Client *c, *vis_slave, *base = 0;
+
+ for(tiled_count = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), tiled_count++);
+ if(tiled_count == 0) {
+ return;
+ }
+
+ c = nexttiled(m->clients);
+ if (c == m->sel) {
+ // if master is selected, show first slave
+ vis_slave = nexttiled(c->next);
+ } else {
+ vis_slave = m->sel;
+ }
+ if(tiled_count > 1 || (tiled_count == 1 && !c->screen_hog)) {
+ mw = m->ww * m->mfact;
+ } else {
+ // one of these:
+ // * zero tiled windows
+ // * one tiled window that's not a screen hog
+ // * miltiple tiled windows
+ mw = m->ww;
+ }
+ right_width = m->ww - mw;
+ tabs_count = tiled_count - 2;
+ cur_tab = 0;
+ for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
+ if (i == 0) {
+ resize(c, m->wx, m->wy, mw, m->wh, False, 0);
+ } else {
+ if (c == vis_slave) {
+ resize(c, m->wx + mw, m->wy, right_width, m->wh - 30, False, base);
+ } else {
+ // this function does not get called when focus changes
+ // resize(c, m->wx + m->ww, m->wy, m->ww - mw, m->wh, False);
+ resize(c, m->wx + mw + right_width * cur_tab / tabs_count, m->wy + m->wh - 20, right_width, m->wh - 30, False, base);
+ cur_tab += 1;
+ }
+ }
+ base = c;
+ }
+}
+
+void