http://www.mirrorservice.org/sites/master.us.finkmirrors.net/distfiles/md5/fa43fdd68d...
[xscreensaver] / hacks / slidescreen.c
index 69f67df6a51174671f943ebf83cd3ab3c58e6f82..dde3a21a5936da401ef191753ed345557d72d877 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1992, 1993, 1994, 1996, 1997, 1998 
+/* xscreensaver, Copyright (c) 1992, 1993, 1994, 1996, 1997, 1998, 2001, 2003 
  * Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
@@ -36,7 +36,7 @@ init_slide (Display *dpy, Window window)
   Visual *visual;
 
   XGetWindowAttributes (dpy, window, &xgwa);
-  grab_screen_image (xgwa.screen, window);
+  load_random_image (xgwa.screen, window, window);
   cmap = xgwa.colormap;
   visual = xgwa.visual;
   max_width = xgwa.width;
@@ -48,6 +48,12 @@ init_slide (Display *dpy, Window window)
   pix_inc = get_integer_resource ("pixelIncrement", "Integer");
   border = get_integer_resource ("internalBorderWidth", "InternalBorderWidth");
 
+  /* Don't let the grid be smaller than 3x3 */
+  if (grid_size > xgwa.width / 3)
+    grid_size = xgwa.width / 3;
+  if (grid_size > xgwa.height / 3)
+    grid_size = xgwa.height / 3;
+
   {
     XColor fgc, bgc;
     char *fgs = get_string_resource("background", "Background");