commit 3957992efe186a8315d6a3f228871c731c435e62
parent 612a498140a42383b965064ee463c14300656312
Author: Sander van Dijk <sander@wmii.de>
Date: Tue, 25 Apr 2006 23:11:49 +0200
some style changes in the code, improve readability
Diffstat:
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/cmd/wm/area.c b/cmd/wm/area.c
@@ -160,10 +160,10 @@ send_to_area(Area *to, Area *from, Client *c)
void
place_client(Area *a, Client *c)
{
- static unsigned int mx, my, offset;
+ static unsigned int mx, my;
static Bool *field = nil;
Bool fit = False;
- unsigned int i, j, k, x, y, maxx, maxy, dx, dy, cx, cy;
+ unsigned int i, j, k, x, y, maxx, maxy, dx, dy, cx, cy, diff;
XPoint p1 = {0, 0}, p2 = {0, 0};
Frame *f = c->frame.data[c->sel];
@@ -231,15 +231,15 @@ place_client(Area *a, Client *c)
if(fit && (p1.x + f->rect.width < a->rect.x + a->rect.width))
f->rect.x = p1.x;
else {
- offset = (a->rect.width - f->rect.width) > 0 ? (a->rect.width - f->rect.width) : 1;
- f->rect.x = a->rect.x + (random()%offset);
+ diff = a->rect.width - f->rect.width;
+ f->rect.x = a->rect.x + (random() % (diff ? diff : 1));
}
if(fit && (p1.y + f->rect.height < a->rect.y + a->rect.height))
f->rect.y = p1.y;
else {
- offset = (a->rect.height - f->rect.height) > 0 ? (a->rect.height - f->rect.height) : 1;
- f->rect.y = a->rect.y + (random()%offset);
+ diff = a->rect.height - f->rect.height;
+ f->rect.y = a->rect.y + (random() % (diff ? diff : 1));
}
}
diff --git a/cmd/wm/view.c b/cmd/wm/view.c
@@ -383,12 +383,12 @@ update_views()
}
for(i=0; i < view.size; i++) {
- Bool destroy = True;
+ Bool only_wildcards = True;
for(j=0; j < client.size; j++) {
if(is_view_of(client.data[j], view.data[i]))
- destroy = False;
+ only_wildcards = False;
}
- if(destroy && view.size > 1) {
+ if(only_wildcards && view.size > 1) {
for(j=0; j < client.size; j++) {
if(is_of_view(view.data[i], client.data[j]))
detach_from_view(view.data[i], client.data[j]);