http://www.mirrorservice.org/sites/master.us.finkmirrors.net/distfiles/md5/fa43fdd68d...
[xscreensaver] / hacks / zoom.c
index 5e7672a2b03366f53a9e5fb3118d7198ed8c031f..8911c7ba4cb39c1f1911d6c1b2aa991efd9442fb 100644 (file)
@@ -99,20 +99,21 @@ static void init_hack(Display *dpy, Window window)
     gcflags |= GCSubwindowMode;
   window_gc = XCreateGC(dpy, window, gcflags, &gcv);
 
-  grab_screen_image(xgwa.screen, window);
+
+  orig_map = NULL;
+  pm = XCreatePixmap(dpy, window, sizex, sizey, xgwa.depth);
+  load_random_image (xgwa.screen, window, pm);
+
+  if (!lenses) {
+    orig_map = XGetImage(dpy, pm, 0, 0, sizex, sizey, ~0L, ZPixmap);
+    XFreePixmap(dpy, pm);
+    pm = 0;
+  }
 
   /* We might have needed this to grab the image, but if we leave this set
      to GCSubwindowMode, then we'll *draw* right over subwindows too. */
   XSetSubwindowMode (dpy, window_gc, ClipByChildren);
 
-  if (lenses) {
-    orig_map = NULL;
-    pm = XCreatePixmap(dpy, window, sizex, sizey, xgwa.depth);
-    XCopyArea(dpy, window, pm, window_gc, 0, 0, sizex, sizey, 0, 0);
-  } else {
-    orig_map = XGetImage(dpy, window, 0, 0, sizex, sizey, ~0L, ZPixmap);
-    pm = 0;
-  }
 
   XFillRectangle(dpy, window, window_gc, 0, 0, sizex, sizey);
   XSetWindowBackground(dpy, window, bg);