static void propertynotify(XEvent *e);
static void quit(const Arg *arg);
static Monitor *recttomon(int x, int y, int w, int h);
-static void resize(Client *c, int x, int y, int w, int h, Bool interact);
-static void resizeclient(Client *c, int x, int y, int w, int h);
+static void resize(Client *c, int x, int y, int w, int h, Bool interact, Client *base);
+static void resizeclient(Client *c, int x, int y, int w, int h, Client *base);
static void resizemouse(const Arg *arg);
static void restack(Monitor *m);
static void run(void);
} else if (c == master || c == slave) {
window_set_translucent(c);
} else {
- window_set_invisible(c);
+ window_set_opaque(c);
}
}
}
XDeleteProperty(dpy, root, netatom[NetActiveWindow]);
}
selmon->sel = c;
+ jason_layout(selmon);
update_window_opacities(selmon);
drawbars();
if(c && (!root || (c->win!=root)) )
if(n > 0) /* override layout symbol */
snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n);
for(c = nexttiled(m->clients); c; c = nexttiled(c->next))
- resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, False);
+ resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, False, 0);
}
void
togglefloating(NULL);
}
if(!selmon->lt[selmon->sellt]->arrange || c->isfloating)
- resize(c, nx, ny, c->w, c->h, True);
+ resize(c, nx, ny, c->w, c->h, True, 0);
break;
}
} while(ev.type != ButtonRelease);
}
void
-resize(Client *c, int x, int y, int w, int h, Bool interact) {
+resize(Client *c, int x, int y, int w, int h, Bool interact, Client *base) {
if(applysizehints(c, &x, &y, &w, &h, interact))
- resizeclient(c, x, y, w, h);
+ resizeclient(c, x, y, w, h, base);
}
void
-resizeclient(Client *c, int x, int y, int w, int h) {
+resizeclient(Client *c, int x, int y, int w, int h, Client *base) {
XWindowChanges wc;
+ unsigned long mask = CWX|CWY|CWWidth|CWHeight|CWBorderWidth;
c->oldx = c->x; c->x = wc.x = x;
c->oldy = c->y; c->y = wc.y = y;
c->oldw = c->w; c->w = wc.width = w;
c->oldh = c->h; c->h = wc.height = h;
+ if (base) {
+ wc.stack_mode = Above;
+ wc.sibling = base->win;
+ mask |= CWStackMode|CWSibling;
+ }
wc.border_width = c->bw;
- XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
+ XConfigureWindow(dpy, c->win, mask, &wc);
configure(c);
XSync(dpy, False);
}
togglefloating(NULL);
}
if(!selmon->lt[selmon->sellt]->arrange || c->isfloating)
- resize(c, c->x, c->y, nw, nh, True);
+ resize(c, c->x, c->y, nw, nh, True, 0);
break;
}
} while(ev.type != ButtonRelease);
if(m->lt[m->sellt]->arrange) {
wc.stack_mode = Below;
wc.sibling = m->barwin;
- for(c = m->stack; c; c = c->snext)
+ for(c = m->clients; c; c = c->next)
if(!c->isfloating && ISVISIBLE(c)) {
XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc);
wc.sibling = c->win;
+ wc.stack_mode = Above;
}
}
XSync(dpy, False);
c->oldbw = c->bw;
c->bw = 0;
c->isfloating = True;
- resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh);
+ resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh, 0);
XRaiseWindow(dpy, c->win);
}
else {
c->y = c->oldy;
c->w = c->oldw;
c->h = c->oldh;
- resizeclient(c, c->x, c->y, c->w, c->h);
+ resizeclient(c, c->x, c->y, c->w, c->h, 0);
arrange(c->mon);
}
}
if(ISVISIBLE(c)) { /* show clients top down */
XMoveWindow(dpy, c->win, c->x, c->y);
if((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen)
- resize(c, c->x, c->y, c->w, c->h, False);
+ resize(c, c->x, c->y, c->w, c->h, False, 0);
showhide(c->snext);
}
else { /* hide clients bottom up */
for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
if(i < m->nmaster) {
h = (m->wh - my) / (MIN(n, m->nmaster) - i);
- resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False);
+ resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False, 0);
my += HEIGHT(c);
}
else {
h = (m->wh - ty) / (n - i);
- resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), False);
+ resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), False, 0);
ty += HEIGHT(c);
}
}
void
jason_layout(Monitor *m) {
- unsigned int i, n, mw;
- Client *c, *vis_slave;
+ unsigned int i, tiled_count, mw, right_width, tabs_count, cur_tab;
+ Client *c, *vis_slave, *base = 0;
- for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
- if(n == 0) {
+ for(tiled_count = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), tiled_count++);
+ if(tiled_count == 0) {
return;
}
} else {
vis_slave = m->sel;
}
- if(n > 1 || (n == 1 && !c->screen_hog)) {
+ if(tiled_count > 1 || (tiled_count == 1 && !c->screen_hog)) {
mw = m->ww * m->mfact;
} else {
// one of these:
// * 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);
+ resize(c, m->wx, m->wy, mw, m->wh, False, 0);
} else {
if (c == vis_slave) {
- resize(c, m->wx + mw, m->wy, m->ww - mw, m->wh, False);
+ 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, 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;
}
}
selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed;
if(selmon->sel->isfloating)
resize(selmon->sel, selmon->sel->x, selmon->sel->y,
- selmon->sel->w, selmon->sel->h, False);
+ selmon->sel->w, selmon->sel->h, False, 0);
arrange(selmon);
}