|
|
@@ -226,6 +226,7 @@ static void setclientstate(Client *c, long state); |
|
|
|
static void setfocus(Client *c); |
|
|
|
static void setfullscreen(Client *c, int fullscreen); |
|
|
|
static void setgaps(const Arg *arg); |
|
|
|
static void setoutergaps(const Arg *arg); |
|
|
|
static void setlayout(const Arg *arg); |
|
|
|
static void setmfact(const Arg *arg); |
|
|
|
static void setup(void); |
|
|
@@ -1733,6 +1734,7 @@ gap_copy(Gap *to, const Gap *from) |
|
|
|
to->isgap = from->isgap; |
|
|
|
to->realgap = from->realgap; |
|
|
|
to->gappx = from->gappx; |
|
|
|
to->ogap = from->ogap; |
|
|
|
} |
|
|
|
|
|
|
|
void |
|
|
@@ -1756,6 +1758,26 @@ setgaps(const Arg *arg) |
|
|
|
arrange(selmon); |
|
|
|
} |
|
|
|
|
|
|
|
void |
|
|
|
setoutergaps(const Arg *arg) |
|
|
|
{ |
|
|
|
Gap *p = selmon->gap; |
|
|
|
switch(arg->i) |
|
|
|
{ |
|
|
|
case GAP_TOGGLE: |
|
|
|
p->isgap = 1 - p->isgap; |
|
|
|
break; |
|
|
|
case GAP_RESET: |
|
|
|
gap_copy(p, &default_gap); |
|
|
|
break; |
|
|
|
default: |
|
|
|
p->ogap += arg->i; |
|
|
|
p->isgap = 1; |
|
|
|
} |
|
|
|
p->realgap = MAX(p->realgap, 0); |
|
|
|
p->ogap = p->ogap * p->isgap; |
|
|
|
arrange(selmon); |
|
|
|
} |
|
|
|
void |
|
|
|
setlayout(const Arg *arg) |
|
|
|
{ |
|
|
@@ -1928,7 +1950,7 @@ tagmon(const Arg *arg) |
|
|
|
void |
|
|
|
tile(Monitor *m) |
|
|
|
{ |
|
|
|
unsigned int i, n, h, mw, my, ty; |
|
|
|
unsigned int i, n, h, mw, my, ty, xposition, yposition, xlength, ylength; |
|
|
|
Client *c; |
|
|
|
|
|
|
|
for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); |
|
|
@@ -1938,16 +1960,41 @@ tile(Monitor *m) |
|
|
|
if (n > m->nmaster) |
|
|
|
mw = m->nmaster ? m->ww * m->mfact : 0; |
|
|
|
else |
|
|
|
mw = m->ww - m->gap->gappx - 2*m->gap->ogap; |
|
|
|
for (i = 0, my = ty = m->gap->ogap, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) //May need to change ogap to gappx |
|
|
|
mw = m->ww - m->gap->gappx; |
|
|
|
for (i = 0, my = ty = m->gap->ogap, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) |
|
|
|
if (i < m->nmaster) { |
|
|
|
h = ((m->wh - my) / (MIN(n, m->nmaster) - i)) - (m->gap->ogap / (MIN(n, m->nmaster)) - i) - m->gap->gappx - (m->gap->gappx / (MIN(n, m->nmaster) - i)); |
|
|
|
resize(c, m->wx + m->gap->ogap, m->wy + my, mw - (2*c->bw) - m->gap->gappx, h - (2*c->bw), 0); |
|
|
|
xposition = m->wx + m->gap->ogap; |
|
|
|
yposition = m->wy + my - (m->gap->ogap / 2); |
|
|
|
|
|
|
|
if (m->nmaster == 1) { |
|
|
|
yposition = m->wy + my - (m->gap->ogap / 2); |
|
|
|
} |
|
|
|
|
|
|
|
h = (m->wh - my) / (MIN(n, m->nmaster) - i) - m->gap->gappx ; |
|
|
|
|
|
|
|
xlength = mw - (2*c->bw) - m->gap->gappx; |
|
|
|
ylength = h - (2*c->bw); |
|
|
|
|
|
|
|
resize(c, xposition, yposition, xlength, ylength, 0); |
|
|
|
if (my + HEIGHT(c) + m->gap->gappx < m->wh) |
|
|
|
my += HEIGHT(c) + m->gap->gappx; |
|
|
|
} else { |
|
|
|
h = ((m->wh - ty) / (n - i)) - (m->gap->ogap / (n - i)) - m->gap->gappx - (m->gap->gappx / (n - i)); |
|
|
|
resize(c, m->wx + mw + m->gap->gappx, m->wy + ty, m->ww - mw - (2*c->bw) - 2*m->gap->gappx, h - (2*c->bw), 0); |
|
|
|
if (i == n - 1) { |
|
|
|
h = (m->wh - ty) / (n - i) - m->gap->ogap; //+ m->gap->gappx / (n - m->nmaster); |
|
|
|
} else { |
|
|
|
h = (m->wh - ty) / (n - i) - m->gap->gappx; |
|
|
|
} |
|
|
|
|
|
|
|
h = (m->wh - ty) / (n - i) - m->gap->gappx; |
|
|
|
yposition = m->wy + ty - (m->gap->ogap / 2); |
|
|
|
if (n - m->nmaster == 1) { |
|
|
|
yposition = m->wy + ty - (m->gap->ogap / 2); |
|
|
|
} |
|
|
|
|
|
|
|
xposition = m->wx + mw + m->gap->ogap + m->gap->gappx; |
|
|
|
xlength = m->ww - mw - (2*c->bw) - 2*m->gap->ogap - m->gap->gappx; |
|
|
|
ylength = h - (2*c->bw); |
|
|
|
resize(c, xposition, yposition, xlength, ylength, 0); |
|
|
|
if (ty + HEIGHT(c) + m->gap->gappx < m->wh) |
|
|
|
ty += HEIGHT(c) + m->gap->gappx; |
|
|
|
} |
|
|
|