projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
http://packetstormsecurity.org/UNIX/admin/xscreensaver-4.00.tar.gz
[xscreensaver]
/
hacks
/
jigsaw.c
diff --git
a/hacks/jigsaw.c
b/hacks/jigsaw.c
index 892315e73036268966985e6f4ae3c8976ba4f8cb..bdbe44684a79929531e4a8658e04342a276cd443 100644
(file)
--- a/
hacks/jigsaw.c
+++ b/
hacks/jigsaw.c
@@
-1,4
+1,4
@@
-/* xscreensaver, Copyright (c) 1997, 1998
Jamie Zawinski <jwz@netscape.com
>
+/* xscreensaver, Copyright (c) 1997, 1998
, 2001 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
@@
-190,6
+190,14
@@
jigsaw_init(Display *dpy, Window window)
x_border = (xgwa.width - (width * GRID_WIDTH)) / 2;
y_border = (xgwa.height - (height * GRID_WIDTH)) / 2;
x_border = (xgwa.width - (width * GRID_WIDTH)) / 2;
y_border = (xgwa.height - (height * GRID_WIDTH)) / 2;
+ if (width < 4 || height < 4)
+ {
+ fprintf (stderr, "%s: window too small: %dx%d (need at least %dx%d)\n",
+ progname, xgwa.width, xgwa.height,
+ GRID_WIDTH * 4, GRID_HEIGHT * 4);
+ exit (1);
+ }
+
if (!state)
state = (XPoint *) malloc(width * height * sizeof(XPoint));
gc = XCreateGC (dpy, window, 0, &gcv);
if (!state)
state = (XPoint *) malloc(width * height * sizeof(XPoint));
gc = XCreateGC (dpy, window, 0, &gcv);
@@
-533,10
+541,13
@@
done(void)
char *progclass = "Jigsaw";
char *defaults [] = {
char *progclass = "Jigsaw";
char *defaults [] = {
- "
*
background: Black",
- "
*
foreground: Gray40",
+ "
.
background: Black",
+ "
.
foreground: Gray40",
"*delay: 70000",
"*delay2: 5",
"*delay: 70000",
"*delay2: 5",
+#ifdef __sgi /* really, HAVE_READ_DISPLAY_EXTENSION */
+ "*visualID: Best",
+#endif
0
};
0
};
@@
-567,10
+578,12
@@
screenhack (Display *dpy, Window window)
while (!done())
{
unshuffle(dpy, window);
while (!done())
{
unshuffle(dpy, window);
- XSync (dpy, True);
+ XSync (dpy, False);
+ screenhack_handle_events (dpy);
if (delay) usleep (delay);
}
if (delay) usleep (delay);
}
+ screenhack_handle_events (dpy);
if (delay2)
usleep (delay2 * 1000000);
if (delay2)
usleep (delay2 * 1000000);