wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit 7bb382a3966874a33cd619454ddca76d13c3670a
parent 4b515ad6d404938757fb0052ce3bf55fb0e487d5
Author: Kris Maglione <jg@suckless.org>
Date:   Wed, 14 Feb 2007 15:03:24 -0500

Fixed crash with opaque moves in floating mode.


Diffstat:
view.c | 19++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/view.c b/view.c @@ -254,16 +254,21 @@ XRectangle * rects_of_view(View *v, uint *num, Frame *ignore) { XRectangle *result; Frame *f; + int i; - *num = 2; - for(f=v->area->frame; f; f=f->anext, (*num)++); - result = ixp_emallocz(*num * sizeof(XRectangle)); + i = 2; + for(f=v->area->frame; f; f=f->anext); + i++; + result = ixp_emallocz(i * sizeof(XRectangle)); + + i = 0; for(f=v->area->frame; f; f=f->anext) if(f != ignore) - *result++ = f->rect; - *result++ = screen->rect; - *result++ = screen->brect; - return result - *num; + result[i++] = f->rect; + result[i++] = screen->rect; + result[i++] = screen->brect; + *num = i; + return result; } /* XXX: This will need cleanup */