optimize computing a bit
This commit is contained in:
parent
9130abb0fe
commit
d990643b5f
|
@ -141,6 +141,8 @@ _tile(Display *disp, awesome_config *awesomeconf, const Bool right)
|
||||||
else
|
else
|
||||||
mh = mw = 0;
|
mh = mw = 0;
|
||||||
|
|
||||||
|
mw -= 2 * c->border;
|
||||||
|
|
||||||
if(otherwin < awesomeconf->ncols)
|
if(otherwin < awesomeconf->ncols)
|
||||||
real_ncols = otherwin;
|
real_ncols = otherwin;
|
||||||
else
|
else
|
||||||
|
@ -152,9 +154,9 @@ _tile(Display *disp, awesome_config *awesomeconf, const Bool right)
|
||||||
if(li < awesomeconf->nmaster)
|
if(li < awesomeconf->nmaster)
|
||||||
{ /* master */
|
{ /* master */
|
||||||
ny = way + li * mh;
|
ny = way + li * mh;
|
||||||
nx = wax + (right ? 0: waw - mw);
|
nx = wax + (right ? 0: waw - (mw + 2 * c->border));
|
||||||
nw = mw - 2 * c->border;
|
|
||||||
nh = mh - 2 * c->border;
|
nh = mh - 2 * c->border;
|
||||||
|
resize(c, nx, ny, mw, nh, awesomeconf->resize_hints);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ /* tile window */
|
{ /* tile window */
|
||||||
|
@ -171,16 +173,16 @@ _tile(Display *disp, awesome_config *awesomeconf, const Bool right)
|
||||||
else
|
else
|
||||||
nh = (wah / win_by_col) - 2 * c->border;
|
nh = (wah / win_by_col) - 2 * c->border;
|
||||||
|
|
||||||
nw = (waw - mw) / real_ncols - 2 * c->border;
|
nw = (waw - (mw + 2 * c->border)) / real_ncols - 2 * c->border;
|
||||||
|
|
||||||
if(li == awesomeconf->nmaster || otherwin <= real_ncols || (li - awesomeconf->nmaster) % win_by_col == 0)
|
if(li == awesomeconf->nmaster || otherwin <= real_ncols || (li - awesomeconf->nmaster) % win_by_col == 0)
|
||||||
ny = way;
|
ny = way;
|
||||||
else
|
else
|
||||||
ny = way + ((li - awesomeconf->nmaster) % win_by_col) * (nh + 2 * c->border);
|
ny = way + ((li - awesomeconf->nmaster) % win_by_col) * (nh + 2 * c->border);
|
||||||
|
|
||||||
nx = wax + current_col * nw + (right ? mw : 0);
|
nx = wax + current_col * nw + (right ? mw + 2 * c->border : 0);
|
||||||
|
resize(c, nx, ny, nw, nh, awesomeconf->resize_hints);
|
||||||
}
|
}
|
||||||
resize(c, nx, ny, nw, nh, awesomeconf->resize_hints);
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
XFree(screens_info);
|
XFree(screens_info);
|
||||||
|
|
Loading…
Reference in New Issue