From 0a87eed676db8176ca02552981afee9dbeffe15f Mon Sep 17 00:00:00 2001 From: "Anselm R. Garbe" Date: Wed, 1 Mar 2006 16:59:42 +0100 Subject: [PATCH] fixed COL_MAX handling --- cmd/wm/column.c | 23 ++++++++++++++--------- rc/wmiirc | 2 +- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/cmd/wm/column.c b/cmd/wm/column.c index 8cd4ff67..459dfea8 100644 --- a/cmd/wm/column.c +++ b/cmd/wm/column.c @@ -25,10 +25,10 @@ str2colmode(char *arg) { if(!strncmp("equal", arg, 6)) return COL_EQUAL; - else if(!strncmp("stack", arg, 6)) - return COL_STACK; - else if(!strncmp("max", arg, 4)) + if(!strncmp("stack", arg, 6)) return COL_STACK; + if(!strncmp("max", arg, 4)) + return COL_MAX; return -1; } @@ -86,12 +86,16 @@ arrange_column(Area *col) /* some relaxing due to potential increment gaps */ h = w = 0; for(i = 0; i < col->nclient; i++) { - h += col->client[i]->frame.rect.height; - if(w < col->client[i]->frame.rect.width) - w = col->client[i]->frame.rect.width; + Client *c = col->client[i]; + if(col->mode == COL_MAX) { + if(h < c->frame.rect.height) + h = c->frame.rect.height; + } + else + h += c->frame.rect.height; + if(w < c->frame.rect.width) + w = c->frame.rect.width; } - if(col->mode == COL_MAX) - h = col->client[i]->frame.rect.height; hdiff = (col->rect.height - h) / col->nclient; wdiff = (col->rect.width - w) / 2; @@ -100,7 +104,8 @@ arrange_column(Area *col) Client *c = col->client[i]; c->frame.rect.x += wdiff; c->frame.rect.y = yoff; - yoff = c->frame.rect.y + c->frame.rect.height + hdiff; + if(col->mode != COL_MAX) + yoff = c->frame.rect.y + c->frame.rect.height + hdiff; resize_client(c, &c->frame.rect, 0, False); } } diff --git a/rc/wmiirc b/rc/wmiirc index ff9a886c..93274c01 100644 --- a/rc/wmiirc +++ b/rc/wmiirc @@ -130,7 +130,7 @@ do $MODKEY-Control-a) `proglist CONFPREFIX/wmii-3:$HOME/.wmii-3 | wmiimenu` &;; $MODKEY-t) - extern xterm &;; + extern xterm -rv&;; $MODKEY-n) wmiir read /sel/new >/dev/null;; $MODKEY-Shift-m)