http://ftp.x.org/contrib/applications/xscreensaver-3.23.tar.gz
[xscreensaver] / hacks / drift.c
index 395a1ec5099d1ed880107eee80af921d72f7b035..6e5399fea4f7eb14fea62ecdc0f13534895a61ae 100644 (file)
@@ -20,7 +20,7 @@ static const char sccsid[] = "@(#)drift.c     4.02 97/04/01 xlockmore";
  * other special, indirect and consequential damages.
  *
  * Revision History:
- * 10-May-97: jwz@netscape.com: turned into a standalone program.
+ * 10-May-97: jwz@jwz.org: turned into a standalone program.
  * 01-Jan-97: Moved new flame to drift.  Compile time options now run time.
  * 01-Jun-95: Updated by Scott Draves.
  * 27-Jun-91: vary number of functions used.
@@ -38,6 +38,7 @@ static const char sccsid[] = "@(#)drift.c     4.02 97/04/01 xlockmore";
                                        "*ncolors:              200   \n"
 # define SMOOTH_COLORS
 # include "xlockmore.h"                                /* from the xscreensaver distribution */
+# include "erase.h"
 #else  /* !STANDALONE */
 # include "xlock.h"                                    /* from the xlockmore distribution */
 #endif /* !STANDALONE */
@@ -221,7 +222,6 @@ initmode(ModeInfo * mi, int mode)
                dp->fractal_len = 2000000;
        }
        dp->fractal_len = (dp->fractal_len * MI_BATCHCOUNT(mi)) / 20;
-
        XClearWindow(MI_DISPLAY(mi), MI_WINDOW(mi));
 }
 
@@ -581,8 +581,14 @@ draw_drift(ModeInfo * mi)
                draw(mi, dp, window);
                if (dp->total_points++ > dp->fractal_len) {
                        draw_flush(mi, dp, window);
-                       if (0 == --dp->nfractals)
-                               initmode(mi, frandom(2));
+                       if (0 == --dp->nfractals) {
+#ifdef STANDALONE
+                         XSync(MI_DISPLAY(mi), False);
+                         sleep(4); /* #### make settable */
+                         erase_full_window(MI_DISPLAY(mi), MI_WINDOW(mi));
+#endif /* STANDALONE */
+                         initmode(mi, frandom(2));
+                       }
                        initfractal(mi);
                }
                dp->timer--;