http://packetstormsecurity.org/UNIX/admin/xscreensaver-4.01.tar.gz
[xscreensaver] / hacks / starfish.c
index fa5a7124c26f09a2af648abeffbadaa03d058d8d..c0cf075717ad3609b2f676c3b8dc403550090e25 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1997 Jamie Zawinski <jwz@netscape.com>
+/* xscreensaver, Copyright (c) 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
@@ -10,6 +10,7 @@
  */
 
 #include <math.h>
+#include <time.h>
 #include <sys/time.h> /* for gettimeofday() */
 #include "screenhack.h"
 #include "spline.h"
@@ -422,8 +423,8 @@ run_starfish (Display *dpy, Window window, struct starfish *s)
 char *progclass = "Starfish";
 
 char *defaults [] = {
-  "Starfish.background:        black",         /* to placate SGI */
-  "Starfish.foreground:        white",
+  ".background:                black",
+  ".foreground:                white",
   "*delay:             10000",
   "*cycleDelay:                100000",
   "*thickness:         0",             /* pixels, 0 = random */
@@ -470,8 +471,9 @@ screenhack (Display *dpy, Window window)
   while (1)
     {
       run_starfish (dpy, window, s);
-      XSync (dpy, True);
+      XSync (dpy, False);
 
+      screenhack_handle_events (dpy);
       if (cycle_p && cycle_delay)
        {
          if (cycle_delay <= delay)
@@ -518,6 +520,7 @@ screenhack (Display *dpy, Window window)
                  while (i < delay2)
                    {
                      rotate_colors (dpy, cmap, colors, ncolors, direction);
+                      screenhack_handle_events (dpy);
                      usleep(cycle_delay);
                      i += cycle_delay;
                    }