commit 9d96bc2fe6e4454f4f9d9e94d2c36a73752e7b31
parent 80bde63776b80e6454984c0f58100c638f55816f
Author: Sander van Dijk <sander@wmii.de>
Date: Thu, 23 Mar 2006 21:39:02 +0100
introduce a min_colwidth (32 pix for now), limit the amount of columns to screenwidth/(2*min_colwidth)
Diffstat:
3 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/cmd/wm/area.c b/cmd/wm/area.c
@@ -407,12 +407,12 @@ drop_resize(Frame *f, XRectangle *new)
/* horizontal resize */
if(west && (new->x != f->rect.x)) {
horiz_resize = True;
- if(new->x < 0 || new->x < (west->rect.x + min)) {
- new->width -= (west->rect.x + min) - new->x;
- new->x = west->rect.x + min;
- } else if(new->width < min) {
- new->x -= min - new->width;
- new->width = min;
+ if(new->x < 0 || new->x < (west->rect.x + MIN_COLWIDTH)) {
+ new->width -= (west->rect.x + MIN_COLWIDTH) - new->x;
+ new->x = west->rect.x + MIN_COLWIDTH;
+ } else if(new->width < MIN_COLWIDTH) {
+ new->x -= MIN_COLWIDTH - new->width;
+ new->width = MIN_COLWIDTH;
}
west->rect.width = new->x - west->rect.x;
a->rect.width += a->rect.x - new->x;
@@ -422,10 +422,10 @@ drop_resize(Frame *f, XRectangle *new)
}
if(east && (new->x + new->width != f->rect.x + f->rect.width)) {
horiz_resize = True;
- if((new->x + new->width) > (east->rect.x + east->rect.width - min))
- new->width = (east->rect.x + east->rect.width - min) - new->x;
- else if(new->width < min)
- new->width = min;
+ if((new->x + new->width) > (east->rect.x + east->rect.width - MIN_COLWIDTH))
+ new->width = (east->rect.x + east->rect.width - MIN_COLWIDTH) - new->x;
+ else if(new->width < MIN_COLWIDTH)
+ new->width = MIN_COLWIDTH;
east->rect.width -= new->x + new->width - east->rect.x;
east->rect.x = new->x + new->width;
a->rect.width = (new->x + new->width) - a->rect.x;
diff --git a/cmd/wm/client.c b/cmd/wm/client.c
@@ -506,7 +506,7 @@ send2area_client(Client *c, char *arg)
if(i == -1)
return;
if(!strncmp(arg, "new", 4) && i) {
- if(a->nframe == 1)
+ if(a->nframe == 1 || v->narea - 1 >= rect.width / (2 * MIN_COLWIDTH))
return;
to = alloc_area(v);
arrange_tag(v, True);
diff --git a/cmd/wm/wm.h b/cmd/wm/wm.h
@@ -66,6 +66,7 @@ enum {
#define MAX_TAGS 8
#define MAX_TAGLEN 32
#define WM_PROTOCOL_DELWIN 1
+#define MIN_COLWIDTH 32
typedef struct View View;
typedef struct Area Area;