fixed cyclic calls of resize_client because it called resize_area (this is only called explicitely now)

This commit is contained in:
Anselm R. Garbe 2006-03-15 16:00:39 +01:00
parent 8e61f1b496
commit 2851ce5b02
7 changed files with 31 additions and 27 deletions

View File

@ -141,7 +141,7 @@ attach_toarea(Area *a, Client *c)
if(area2index(a)) /* column */
arrange_area(a);
else /* floating */
resize_client(c, &f->rect, nil, False);
resize_client(c, &f->rect, False);
}
void
@ -248,7 +248,7 @@ relax_area(Area *a)
Frame *f = a->frame[i];
f->rect.x = a->rect.x + (a->rect.width - f->rect.width) / 2;
f->rect.y = a->rect.y + (a->rect.height - f->rect.height) / 2;
resize_client(f->client, &f->rect, nil, False);
resize_client(f->client, &f->rect, False);
}
return;
}
@ -271,7 +271,7 @@ relax_area(Area *a)
Frame *f = a->frame[i];
unsigned int tmp = f->rect.height;
f->rect.height += (a->rect.height - h);
resize_client(f->client, &f->rect, nil, True);
resize_client(f->client, &f->rect, True);
h += (f->rect.height - tmp);
}
}
@ -284,7 +284,7 @@ relax_area(Area *a)
f->rect.y = yoff;
if(a->mode != Colmax)
yoff = f->rect.y + f->rect.height + hdiff;
resize_client(f->client, &f->rect, nil, False);
resize_client(f->client, &f->rect, False);
}
}
@ -311,7 +311,7 @@ arrange_area(Area *a)
else
f->rect.height =
a->rect.height - f->rect.y + a->rect.y;
resize_client(f->client, &f->rect, nil, True);
resize_client(f->client, &f->rect, True);
}
break;
case Colstack:
@ -328,7 +328,7 @@ arrange_area(Area *a)
else
f->rect.height = bar_height();
yoff += f->rect.height;
resize_client(f->client, &f->rect, nil, True);
resize_client(f->client, &f->rect, True);
}
break;
Fallthrough:
@ -336,7 +336,7 @@ Fallthrough:
for(i = 0; i < a->nframe; i++) {
Frame *f = a->frame[i];
f->rect = a->rect;
resize_client(f->client, &f->rect, nil, True);
resize_client(f->client, &f->rect, True);
}
break;
default:
@ -376,7 +376,7 @@ match_horiz(Area *a, XRectangle *r)
Frame *f = a->frame[i];
f->rect.x = r->x;
f->rect.width = r->width;
resize_client(f->client, &f->rect, nil, False);
resize_client(f->client, &f->rect, False);
}
}
@ -421,16 +421,16 @@ drop_resize(Frame *f, XRectangle *new)
north->rect.height = new->y - north->rect.y;
f->rect.height += f->rect.y - new->y;
f->rect.y = new->y;
resize_client(north->client, &north->rect, nil, False);
resize_client(f->client, &f->rect, nil, False);
resize_client(north->client, &north->rect, False);
resize_client(f->client, &f->rect, False);
}
if(south && (new->y + new->height != f->rect.y + f->rect.height)) {
south->rect.height -= new->y + new->height - south->rect.y;
south->rect.y = new->y + new->height;
f->rect.y = new->y;
f->rect.height = new->height;
resize_client(f->client, &f->rect, nil, False);
resize_client(south->client, &south->rect, nil, False);
resize_client(f->client, &f->rect, False);
resize_client(south->client, &south->rect, False);
}
relax_area(a);
}
@ -471,8 +471,7 @@ void
resize_area(Client *c, XRectangle *r, XPoint *pt)
{
Frame *f = c->frame[c->sel];
if((f->rect.width == r->width)
&& (f->rect.height == r->height))
if((f->rect.width == r->width) && (f->rect.height == r->height))
drop_moving(f, r, pt);
else
drop_resize(f, r);

View File

@ -70,7 +70,7 @@ update_bar_geometry()
}
for(j = 0; j < tag[i]->area[0]->nframe; j++) {
Frame *f = tag[i]->area[0]->frame[j];
resize_client(f->client, &f->rect, nil, False);
resize_client(f->client, &f->rect, False);
}
}
}

View File

@ -435,14 +435,10 @@ match_sizehints(Client *c)
}
void
resize_client(Client *c, XRectangle *r, XPoint *pt, Bool ignore_xcall)
resize_client(Client *c, XRectangle *r, Bool ignore_xcall)
{
Frame *f = c->frame[c->sel];
if(area2index(f->area))
resize_area(c, r, pt);
else
f->rect = *r;
f->rect = *r;
if((f->area->mode != Colstack) || (f->area->sel == frame2index(f)))
match_sizehints(c);
@ -545,7 +541,7 @@ resize_all_clients()
for(i = 0; i < nclient; i++) {
Client *c = client[i];
if(c->nframe && c->frame[c->sel]->area)
resize_client(c, &c->frame[c->sel]->rect, 0, False);
resize_client(c, &c->frame[c->sel]->rect, False);
}
}

View File

@ -1271,7 +1271,10 @@ xwrite(IXPConn *c, Fcall *fcall)
if(m->qid.dir_type == FsDclient) {
f = tag[i1]->area[i2]->frame[i3];
blitz_strtorect(&rect, &f->rect, buf);
resize_client(f->client, &f->rect, 0, False);
if(i2)
resize_area(f->client, &f->rect, nil);
else
resize_client(f->client, &f->rect, False);
}
break;
case FsFexpand:

View File

@ -333,7 +333,10 @@ mouse_move(Client *c)
case ButtonRelease:
if(!first) {
draw_pseudo_border(&frect);
resize_client(c, &frect, &pt, False);
if(area2index(c->frame[c->sel]->area))
resize_area(c, &frect, &pt);
else
resize_client(c, &frect, False);
}
free(rects);
XUngrabPointer(dpy, CurrentTime /* ev.xbutton.time */ );
@ -579,7 +582,10 @@ mouse_resize(Client *c, Align align)
draw_pseudo_border(&frect);
pt.x = px;
pt.y = py;
resize_client(c, &frect, &pt, False);
if(area2index(c->frame[c->sel]->area))
resize_area(c, &frect, &pt);
else
resize_client(c, &frect, False);
}
XUngrabPointer(dpy, CurrentTime /* ev.xbutton.time */ );
XUngrabServer(dpy);

View File

@ -93,7 +93,7 @@ focus_tag(Tag *t)
if(f->area->tag == t) {
XMoveWindow(dpy, client[i]->framewin, f->rect.x, f->rect.y);
if(client[i]->nframe > 1)
resize_client(client[i], &f->rect, nil, False);
resize_client(client[i], &f->rect, False);
draw_client(client[i]);
}
else

View File

@ -253,7 +253,7 @@ void manage_client(Client *c);
void destroy_client(Client *c);
Client *sel_client();
void focus_client(Client *c);
void resize_client(Client *c, XRectangle *r, XPoint *pt, Bool ignore_xcall);
void resize_client(Client *c, XRectangle *r, Bool ignore_xcall);
void select_client(Client *c, char *arg);
void send2area_client(Client *c, char *arg);
void resize_all_clients();