commit 4296b31b3c73e0db99f0fcc20e12289ec7d901ec
parent df251f992d8596d2757b96b0a0bd62925eea6b78
Author: Anselm R. Garbe <garbeam@wmii.de>
Date: Mon, 24 Apr 2006 17:19:50 +0200
changed arrange_view signature
Diffstat:
4 files changed, 17 insertions(+), 21 deletions(-)
diff --git a/cmd/wm/area.c b/cmd/wm/area.c
@@ -270,7 +270,7 @@ detach_from_area(Area *a, Client *c)
destroy_area(a);
else if(!a->frame.size && v->area.data[0]->frame.size)
v->sel = 0; /* focus floating area if it contains something */
- arrange_view(v, True);
+ arrange_view(v);
}
else if(!i && !a->frame.size) {
if(c->trans) {
diff --git a/cmd/wm/column.c b/cmd/wm/column.c
@@ -369,7 +369,7 @@ new_left_column(View *v) {
v->area.data[i] = p;
p = n;
}
- arrange_view(v, True);
+ arrange_view(v);
return a;
}
@@ -379,6 +379,6 @@ new_right_column(View *v)
Area *a;
if(!(a = create_area(v)))
return nil;
- arrange_view(v, True);
+ arrange_view(v);
return a;
}
diff --git a/cmd/wm/view.c b/cmd/wm/view.c
@@ -276,7 +276,7 @@ restack_view(View *v)
}
void
-arrange_view(View *v, Bool dirty)
+arrange_view(View *v)
{
unsigned int i, xoff = 0;
unsigned int dx = 0;
@@ -286,24 +286,20 @@ arrange_view(View *v, Bool dirty)
if(v->area.size == 1)
return;
- if(dirty) {
- for(i = 1; i < v->area.size; i++)
- dx += v->area.data[i]->rect.width;
- scale = (float)rect.width / (float)dx;
- }
+ for(i = 1; i < v->area.size; i++)
+ dx += v->area.data[i]->rect.width;
+ scale = (float)rect.width / (float)dx;
for(i = 1; i < v->area.size; i++) {
Area *a = v->area.data[i];
- if(dirty) {
- a->rect.x = xoff;
- a->rect.y = 0;
- a->rect.height = rect.height - brect.height;
- a->rect.width *= scale;
- if(a->rect.width < MIN_COLWIDTH)
- a->rect.width = MIN_COLWIDTH;
- else if((wdiff = a->rect.x + a->rect.width - rect.width + (v->area.size - 1 - i) * MIN_COLWIDTH) > 0)
- a->rect.width -= wdiff;
- xoff += a->rect.width;
- }
+ a->rect.x = xoff;
+ a->rect.y = 0;
+ a->rect.height = rect.height - brect.height;
+ a->rect.width *= scale;
+ if(a->rect.width < MIN_COLWIDTH)
+ a->rect.width = MIN_COLWIDTH;
+ else if((wdiff = a->rect.x + a->rect.width - rect.width + (v->area.size - 1 - i) * MIN_COLWIDTH) > 0)
+ a->rect.width -= wdiff;
+ xoff += a->rect.width;
arrange_column(a, False);
}
}
diff --git a/cmd/wm/wm.h b/cmd/wm/wm.h
@@ -285,7 +285,7 @@ void apply_rules(Client *c);
Bool permit_tags(const char *tags);
/* view.c */
-void arrange_view(View *v, Bool dirty);
+void arrange_view(View *v);
View *create_view(char *name);
void focus_view(View *v);
XRectangle *rects_of_view(View *v, Bool isfloat, unsigned int *num);