axel spotted that memo doesn't hide properly with rio. this patch fixes the problem. andrey Reference: /n/sources/patch/applied/memo-hide Date: Mon Oct 31 19:36:04 CET 2005 --- /sys/src/games/memo.c Mon Oct 31 19:35:28 2005 +++ /sys/src/games/memo.c Mon Oct 31 19:35:27 2005 @@ -4,6 +4,11 @@ #include #include +enum { + Facesize = 48 +}; + + void memoinit(void); void redraw(void); void eresized(int); @@ -180,10 +185,19 @@ void eresized(int new) { + double sq; + Point p; + if(new && getwindow(display, Refnone) < 0){ fprint(2, "can't reattach to window"); exits("resized"); } + + sq = sqrt(level); + p = Pt(Dx(screen->r)+8, Dy(screen->r)+8); + if(!new || !eqpt(p, Pt(Facesize*sq+sq*4+17, Facesize*sq+sq*4+17))) + resize(Facesize*sq+sq*4+17); + allocblocks(); draw(screen, screen->r, back, nil, ZP); redraw(); @@ -192,7 +206,7 @@ void redraw(void) { - int i, nx, ny; + int i; Rectangle r; Point p; @@ -290,9 +304,6 @@ return i; } -enum { - Facesize = 48 }; - void allocblocks(void) { @@ -300,7 +311,6 @@ ushort i, x, y, sq; sq = sqrt(level); - resize(Facesize*sq+sq*4+17); r = insetrect(screen->r, 5); r.max.x = r.min.x+Facesize*sq+sq*4-1; r.max.y = r.min.y+Facesize*sq+sq*4-1;