From http://www.jwz.org/xscreensaver/xscreensaver-5.18.tar.gz
[xscreensaver] / hacks / speedmine.c
index 1ff2db11076c3c7c41340a06085f906e09377048..5c67082dad498be231ed5cdbe16c411be053d737 100644 (file)
@@ -1105,7 +1105,7 @@ render_speedmine (struct state *st, Drawable d)
        } else {
                t = MAX(begin_at(st), TERRAIN_LENGTH/4);
                /*t = TERRAIN_LENGTH/4; dt = 2; */
-               dt = (t >= 3*TERRAIN_LENGTH/4 ? 1 : 2);
+               /*dt = (t >= 3*TERRAIN_LENGTH/4 ? 1 : 2);*/
                i = (st->nearest -t + TERRAIN_LENGTH) % TERRAIN_LENGTH;
                render_block (st, d, st->tunnelend_gc, t);
        }
@@ -1538,6 +1538,16 @@ static void
 speedmine_reshape (Display *dpy, Window window, void *closure, 
                  unsigned int w, unsigned int h)
 {
+  struct state *st = (struct state *) closure;
+  st->width = w;
+  st->height = h;
+  if (st->dbuf != st->window) {
+      XWindowAttributes xgwa;
+      XGetWindowAttributes (st->dpy, st->window, &xgwa);
+      XFreePixmap (dpy, st->dbuf);
+      st->dbuf = XCreatePixmap (st->dpy, st->window, 
+                                st->width, st->height, xgwa.depth);
+  }
 }
 
 static Bool