Fix a bug (I hope) in the swapping code

This commit is contained in:
Kris Maglione 2007-02-05 01:54:39 -05:00
parent bc30e494aa
commit df9d013275
2 changed files with 7 additions and 5 deletions

View File

@ -91,7 +91,8 @@ buttonpress(XEvent *e) {
do_mouse_resize(f->client, CENTER);
break;
case Button3:
do_mouse_resize(f->client, quadofcoord(&f->client->rect, ev->x, ev->y));
do_mouse_resize(f->client,
quadofcoord(&f->client->rect, ev->x, ev->y));
default:
break;
}

View File

@ -67,6 +67,7 @@ swap_frames(Frame *fa, Frame *fb) {
Frame **fp_a, **fp_b, *ft;
if(fa == fb) return;
a = fa->area;
for(fp_a = &a->frame; *fp_a; fp_a=&(*fp_a)->anext)
if(*fp_a == fa) break;
@ -74,16 +75,16 @@ swap_frames(Frame *fa, Frame *fb) {
for(fp_b = &a->frame; *fp_b; fp_b=&(*fp_b)->anext)
if(*fp_b == fb) break;
ft = fa->anext;
fa->anext = fb->anext;
fb->anext = ft;
*fp_a = fb;
*fp_b = fa;
fb->area = fa->area;
fa->area = a;
ft = fa->anext;
fa->anext = fb->anext;
fb->anext = ft;
trect = fa->rect;
fa->rect = fb->rect;
fb->rect = trect;