From http://www.jwz.org/xscreensaver/xscreensaver-5.35.tar.gz
[xscreensaver] / hacks / barcode.c
index cde87e40309db5b9a94ddc7d00c97da79447c4e7..cd3038ce534b1bf4fc109b621232a387bb3bf6db 100644 (file)
@@ -14,6 +14,7 @@
  */
 
 #include <math.h>
+#include <time.h>
 #include "screenhack.h"
 
 /* non-user-modifiable immutable definitions */
@@ -824,7 +825,7 @@ static void drawDigitChar (struct state *st, Bitmap *b, int x, int y, char c)
     if ((c < '0') || (c > '9'))
       c = '0';
 
-    bitmapDrawChar5x8 (b, x, y, c);
+  bitmapDrawChar5x8 (b, x, y, c);
 }
 
 /* draw a upc/ean digit at the given coordinates */
@@ -1728,7 +1729,7 @@ static void updateGrid (struct state *st)
                 s[j] = (random() % 10) + '0';
               s[j++] = '?';
               s[j++] = ':';
-              s[j++] = 0;
+              s[j] = 0;
             }
 
           /* change one digit in this barcode */
@@ -1898,6 +1899,9 @@ static void
 barcode_reshape (Display *dpy, Window window, void *closure, 
                  unsigned int w, unsigned int h)
 {
+  struct state *st = (struct state *) closure;
+  st->windowWidth = w;
+  st->windowHeight = h;
 }
 
 static void
@@ -1911,6 +1915,7 @@ barcode_free (Display *dpy, Window window, void *closure)
 static const char *barcode_defaults [] = {
     ".background:      black",
     ".foreground:      green",
+    "*fpsSolid:        true",
     "*delay:           10000",
     "*mode:            scroll",
     0