commit 20431e4bc1d94b0a73f2de7d94ec955dcab762d8
parent c6ddb166c78c551f98301042e8c7ddaab35590fa
Author: Sander van Dijk <sander@wmii.de>
Date: Thu, 13 Apr 2006 20:44:31 +0000
disallow the creation of new columns if the amount of columns on screen is width/mincolwidth; next up is respecting mincolwidth in the scaling mechanism
Diffstat:
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/cmd/wm/area.c b/cmd/wm/area.c
@@ -17,6 +17,8 @@ vector_of_areas(AreaVector *av)
Area *
create_area(View *v)
{
+ if(v->area.size >= 2 && v->area.size - 1 >= rect.width / MIN_COLWIDTH)
+ return nil;
static unsigned short id = 1;
Area *a = cext_emallocz(sizeof(Area));
a->view = v;
@@ -26,7 +28,7 @@ create_area(View *v)
if(v->area.size > 1)
a->rect.width = rect.width / (v->area.size - 1);
cext_vattach(vector_of_areas(&v->area), a);
- v->sel = v->area.size -1;
+ v->sel = v->area.size - 1;
return a;
}
diff --git a/cmd/wm/client.c b/cmd/wm/client.c
@@ -565,7 +565,8 @@ send_client_to(Client *c, char *arg)
else if(a->frame.size > 1) {
Area *p, *n;
unsigned int j;
- p = to = create_area(v);
+ if(!(p = to = create_area(v)))
+ return;
for(j = 1; j < v->area.size; j++) {
n = v->area.data[j];
v->area.data[j] = p;
@@ -580,7 +581,8 @@ send_client_to(Client *c, char *arg)
if(i < v->area.size - 1)
to = v->area.data[i + 1];
else if(a->frame.size > 1) {
- to = create_area(v);
+ if(!(to = create_area(v)))
+ return;
arrange_view(v, True);
}
else