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

View File

@ -70,7 +70,7 @@ update_bar_geometry()
} }
for(j = 0; j < tag[i]->area[0]->nframe; j++) { for(j = 0; j < tag[i]->area[0]->nframe; j++) {
Frame *f = tag[i]->area[0]->frame[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 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]; Frame *f = c->frame[c->sel];
f->rect = *r;
if(area2index(f->area))
resize_area(c, r, pt);
else
f->rect = *r;
if((f->area->mode != Colstack) || (f->area->sel == frame2index(f))) if((f->area->mode != Colstack) || (f->area->sel == frame2index(f)))
match_sizehints(c); match_sizehints(c);
@ -545,7 +541,7 @@ resize_all_clients()
for(i = 0; i < nclient; i++) { for(i = 0; i < nclient; i++) {
Client *c = client[i]; Client *c = client[i];
if(c->nframe && c->frame[c->sel]->area) 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) { if(m->qid.dir_type == FsDclient) {
f = tag[i1]->area[i2]->frame[i3]; f = tag[i1]->area[i2]->frame[i3];
blitz_strtorect(&rect, &f->rect, buf); 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; break;
case FsFexpand: case FsFexpand:

View File

@ -333,7 +333,10 @@ mouse_move(Client *c)
case ButtonRelease: case ButtonRelease:
if(!first) { if(!first) {
draw_pseudo_border(&frect); 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); free(rects);
XUngrabPointer(dpy, CurrentTime /* ev.xbutton.time */ ); XUngrabPointer(dpy, CurrentTime /* ev.xbutton.time */ );
@ -579,7 +582,10 @@ mouse_resize(Client *c, Align align)
draw_pseudo_border(&frect); draw_pseudo_border(&frect);
pt.x = px; pt.x = px;
pt.y = py; 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 */ ); XUngrabPointer(dpy, CurrentTime /* ev.xbutton.time */ );
XUngrabServer(dpy); XUngrabServer(dpy);

View File

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

View File

@ -253,7 +253,7 @@ void manage_client(Client *c);
void destroy_client(Client *c); void destroy_client(Client *c);
Client *sel_client(); Client *sel_client();
void focus_client(Client *c); 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 select_client(Client *c, char *arg);
void send2area_client(Client *c, char *arg); void send2area_client(Client *c, char *arg);
void resize_all_clients(); void resize_all_clients();