-/* xscreensaver, Copyright (c) 1992, 1993, 1994, 1996, 1997
- * Jamie Zawinski <jwz@netscape.com>
+/* 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
* documentation for any purpose is hereby granted without fee, provided that
Visual *visual;
XGetWindowAttributes (dpy, window, &xgwa);
- grab_screen_image (xgwa.screen, window);
-
- XGetWindowAttributes (dpy, window, &xgwa); /* re-retrieve colormap */
+ load_random_image (xgwa.screen, window, window);
cmap = xgwa.colormap;
visual = xgwa.visual;
max_width = xgwa.width;
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");
XFillRectangle (dpy, d, gc, 0, bitmap_h - yoff, bitmap_w, yoff);
}
- XSync (dpy, True);
+ XSync (dpy, False);
if (delay2) usleep (delay2 * 2);
for (i = 0; i < grid_size; i += pix_inc)
{
points[2].y = points[1].y;
XFillPolygon (dpy, window, gc, points, 3, Convex, CoordModeOrigin);
- XSync (dpy, True);
+ XSync (dpy, False);
if (delay) usleep (delay);
}
break;
}
- XSync (dpy, True);
+ XSync (dpy, False);
if (delay) usleep (delay);
}
switch (dir)
while (1)
{
slide1 (dpy, window);
+ screenhack_handle_events (dpy);
if (delay2) usleep (delay2);
}
}