wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit 0bbae7dd4336aad10d40527c3a8f0c32e9503243
parent 23d83405b69390702fa2087a90e9e56da3a77028
Author: Anselm R. Garbe <garbeam@wmii.de>
Date:   Sun, 12 Mar 2006 11:00:39 +0100

fallback handling to max mode also in relax_area


Diffstat:
cmd/wm/area.c | 28++++++++++++++++++++++++++++
1 file changed, 28 insertions(+), 0 deletions(-)

diff --git a/cmd/wm/area.c b/cmd/wm/area.c @@ -221,10 +221,38 @@ static void relax_area(Area *a) { unsigned int i, yoff, h, hdiff; + Bool fallthrough = False; if(!a->nframe) return; + switch(a->mode) { + case Colequal: + h = a->rect.height; + h /= a->nframe; + if(h < 2 * bar_height()) + fallthrough = True; + break; + case Colstack: + yoff = a->rect.y; + h = a->rect.height - (a->nframe - 1) * bar_height(); + if(h < 3 * bar_height()) + fallthrough = True; + break; + default: + break; + } + + if(fallthrough) { + for(i = 0; i < a->nframe; i++) { + Frame *f = a->frame[i]; + f->rect.x = a->rect.x + (a->rect.width - f->rect.width) / 2; + f->rect.y = a->rect.y + hdiff / 2; + resize_client(f->client, &f->rect, nil, False); + } + return; + } + /* some relaxing from potential increment gaps */ h = 0; for(i = 0; i < a->nframe; i++) {