ftp://ftp.uni-heidelberg.de/pub/X11/contrib/applications/xscreensaver-2.07.tar.gz
[xscreensaver] / hacks / decayscreen.c
index ce18a7ee3a56728bd12db7d60af7ed0442a483f6..604500491fb891d002cdb23e4884ad95497ce4ab 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1992, 1993, 1994 
+/* xscreensaver, Copyright (c) 1992, 1993, 1994, 1996, 1997 
  * Jamie Zawinski <jwz@netscape.com>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
@@ -37,17 +37,12 @@ static int delay;
 static GC gc;
 
 static void
-init_decay (dpy, window)
-     Display *dpy;
-     Window window;
+init_decay (Display *dpy, Window window)
 {
   XGCValues gcv;
   XWindowAttributes xgwa;
-  int root_p;
-  Pixmap pixmap;
 
   delay = get_integer_resource ("delay", "Integer");
-  root_p = get_boolean_resource ("root", "Boolean");
 
   if (delay < 0) delay = 0;
 
@@ -60,8 +55,7 @@ init_decay (dpy, window)
   sizex = xgwa.width;
   sizey = xgwa.height;
 
-  copy_default_colormap_contents (dpy, xgwa.colormap, xgwa.visual);
-  pixmap = grab_screen_image (dpy, window, root_p);
+  grab_screen_image (xgwa.screen, window);
 }
 
 
@@ -69,9 +63,7 @@ init_decay (dpy, window)
  * perform one iteration of decay
  */
 static void
-decay1 (dpy, window)
-     Display *dpy;
-     Window window;
+decay1 (Display *dpy, Window window)
 {
     int left, top, width, height;
 
@@ -121,22 +113,23 @@ decay1 (dpy, window)
 char *progclass = "DecayScreen";
 
 char *defaults [] = {
-  "DecayScreen.mappedWhenManaged:false",
-  "DecayScreen.dontClearWindow:         true",
+  "*dontClearRoot:             True",
+
+#ifdef __sgi   /* really, HAVE_READ_DISPLAY_EXTENSION */
+  "*visualID:                  Best",
+#endif
+
   "*delay:                     10",
   0
 };
 
 XrmOptionDescRec options [] = {
   { "-delay",          ".delay",               XrmoptionSepArg, 0 },
+  { 0, 0, 0, 0 }
 };
 
-int options_size = (sizeof (options) / sizeof (options[0]));
-
 void
-screenhack (dpy, window)
-     Display *dpy;
-     Window window;
+screenhack (Display *dpy, Window window)
 {
     init_decay (dpy, window);
     while (1) {