fallback handling to max mode also in relax_area

This commit is contained in:
Anselm R. Garbe 2006-03-12 11:00:39 +01:00
parent 23d83405b6
commit 0bbae7dd43
1 changed files with 28 additions and 0 deletions

View File

@ -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++) {