projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
http://www.mirrorservice.org/sites/master.us.finkmirrors.net/distfiles/md5/fa43fdd68d...
[xscreensaver]
/
hacks
/
slidescreen.c
diff --git
a/hacks/slidescreen.c
b/hacks/slidescreen.c
index f910dbe7eb9ac15b13dec02d8d5ff3e7b139fafd..dde3a21a5936da401ef191753ed345557d72d877 100644
(file)
--- a/
hacks/slidescreen.c
+++ b/
hacks/slidescreen.c
@@
-1,5
+1,5
@@
-/* 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
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@
-36,9
+36,7
@@
init_slide (Display *dpy, Window window)
Visual *visual;
XGetWindowAttributes (dpy, window, &xgwa);
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;
cmap = xgwa.colormap;
visual = xgwa.visual;
max_width = xgwa.width;
@@
-50,6
+48,12
@@
init_slide (Display *dpy, Window window)
pix_inc = get_integer_resource ("pixelIncrement", "Integer");
border = get_integer_resource ("internalBorderWidth", "InternalBorderWidth");
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");
{
XColor fgc, bgc;
char *fgs = get_string_resource("background", "Background");
@@
-197,7
+201,7
@@
init_slide (Display *dpy, Window window)
XFillRectangle (dpy, d, gc, 0, bitmap_h - yoff, bitmap_w, yoff);
}
XFillRectangle (dpy, d, gc, 0, bitmap_h - yoff, bitmap_w, yoff);
}
- XSync (dpy,
Tru
e);
+ XSync (dpy,
Fals
e);
if (delay2) usleep (delay2 * 2);
for (i = 0; i < grid_size; i += pix_inc)
{
if (delay2) usleep (delay2 * 2);
for (i = 0; i < grid_size; i += pix_inc)
{
@@
-228,7
+232,7
@@
init_slide (Display *dpy, Window window)
points[2].y = points[1].y;
XFillPolygon (dpy, window, gc, points, 3, Convex, CoordModeOrigin);
points[2].y = points[1].y;
XFillPolygon (dpy, window, gc, points, 3, Convex, CoordModeOrigin);
- XSync (dpy,
Tru
e);
+ XSync (dpy,
Fals
e);
if (delay) usleep (delay);
}
if (delay) usleep (delay);
}
@@
-309,7
+313,7
@@
slide1 (Display *dpy, Window window)
break;
}
break;
}
- XSync (dpy,
Tru
e);
+ XSync (dpy,
Fals
e);
if (delay) usleep (delay);
}
switch (dir)
if (delay) usleep (delay);
}
switch (dir)
@@
-331,8
+335,8
@@
char *defaults [] = {
"*visualID: Best",
#endif
"*visualID: Best",
#endif
- "
SlidePuzzle.background:
Black",
- "
SlidePuzzle.foreground:
Gray",
+ "
.background:
Black",
+ "
.foreground:
Gray",
"*gridSize: 70",
"*pixelIncrement: 10",
"*internalBorderWidth: 4",
"*gridSize: 70",
"*pixelIncrement: 10",
"*internalBorderWidth: 4",
@@
-357,6
+361,7
@@
screenhack (Display *dpy, Window window)
while (1)
{
slide1 (dpy, window);
while (1)
{
slide1 (dpy, window);
+ screenhack_handle_events (dpy);
if (delay2) usleep (delay2);
}
}
if (delay2) usleep (delay2);
}
}