http://packetstormsecurity.org/UNIX/admin/xscreensaver-4.03.tar.gz
[xscreensaver] / hacks / greynetic.c
index c3f5fbaf0c22b322ba14d9bcadb0ff29c0f729ba..57840637bb70b0fd69051294a2ef5c5bd23a3120 100644 (file)
@@ -1,5 +1,5 @@
-/* xscreensaver, Copyright (c) 1992, 1995, 1996, 1997
- *  Jamie Zawinski <jwz@netscape.com>
+/* xscreensaver, Copyright (c) 1992, 1995, 1996, 1997, 1998
+ *  Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -89,7 +89,7 @@ greynetic (Display *dpy, Window window)
 {
   static int tick = 500, xlim, ylim;
   static Colormap cmap;
-  int x, y, w, h, i;
+  int x, y, w=0, h=0, i;
   XGCValues gcv;
   if (tick++ == 500)
     {
@@ -152,15 +152,15 @@ greynetic (Display *dpy, Window window)
     }
   XChangeGC (dpy, gc, GCStipple|GCForeground|GCBackground, &gcv);
   XFillRectangle (dpy, window, gc, x, y, w, h);
-  XSync (dpy, True);
+  XSync (dpy, False);
 }
 
 \f
 char *progclass = "Greynetic";
 
 char *defaults [] = {
-  "Greynetic.background:       black",         /* to placate SGI */
-  "Greynetic.foreground:       white",
+  ".background:        black",
+  ".foreground:        white",
   "*delay:     0",
   0
 };
@@ -177,6 +177,7 @@ screenhack (Display *dpy, Window window)
   while (1)
     {
       greynetic (dpy, window);
+      screenhack_handle_events (dpy);
       if (delay) usleep (delay);
     }
 }