X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fdecayscreen.c;h=32f8167ccae35583e27ab2d088a013a383fc645a;hb=65740e2a8dea3d6309ae6e8914a0fb79e993ada8;hp=704f67db35d921818880ed1d251cfbf2274d4a23;hpb=88134d551a9911995c013c5ed06a32c2b1044b85;p=xscreensaver diff --git a/hacks/decayscreen.c b/hacks/decayscreen.c old mode 100644 new mode 100755 index 704f67db..32f8167c --- a/hacks/decayscreen.c +++ b/hacks/decayscreen.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1992 Jamie Zawinski +/* xscreensaver, Copyright (c) 1992, 1993, 1994 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -35,37 +35,6 @@ static int sizex, sizey; static int delay; static GC gc; -static Bool -MapNotify_event_p (dpy, event, window) - Display *dpy; - XEvent *event; - XPointer window; -{ - return (event->xany.type == MapNotify && - event->xvisibility.window == (Window) window); -} - - -static Bool -screensaver_window_p (dpy, window) - Display *dpy; - Window window; -{ - Atom type; - int format; - unsigned long nitems, bytesafter; - char *version; - if (XGetWindowProperty (dpy, window, - XInternAtom (dpy, "_SCREENSAVER_VERSION", False), - 0, 1, False, XA_STRING, - &type, &format, &nitems, &bytesafter, - (unsigned char **) &version) - == Success - && type != None) - return True; - return False; -} - static void init_decay (dpy, window) Display *dpy; @@ -86,11 +55,12 @@ init_decay (dpy, window) gc = XCreateGC (dpy, window, GCForeground |GCFunction | GCSubwindowMode, &gcv); - pixmap = grab_screen_image (dpy, window, root_p); - XGetWindowAttributes (dpy, window, &xgwa); sizex = xgwa.width; sizey = xgwa.height; + + copy_default_colormap_contents (dpy, xgwa.colormap, xgwa.visual); + pixmap = grab_screen_image (dpy, window, root_p); }