projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ftp://ftp.jp.xemacs.org/pub/NetBSD/packages/distfiles/xscreensaver-4.15.tar.gz
[xscreensaver]
/
hacks
/
epicycle.c
diff --git
a/hacks/epicycle.c
b/hacks/epicycle.c
index addaaaaf4365253deca7bfded1ab504660d2e797..01e88d381e3342e594bd077886483d938ec1dca3 100644
(file)
--- a/
hacks/epicycle.c
+++ b/
hacks/epicycle.c
@@
-50,8
+50,8
@@
char *progclass="Epicycle";
* to get pleasing figures.
*/
char *defaults [] = {
* to get pleasing figures.
*/
char *defaults [] = {
- "
*
background: black",
- "
*
foreground: white",
+ "
.
background: black",
+ "
.
foreground: white",
"*colors: 100",
"*color0: red",
"*delay: 1000",
"*colors: 100",
"*color0: red",
"*delay: 1000",
@@
-266,7
+266,10
@@
new_circle_chain(void)
/* There are between minCircles and maxCircles in each figure.
*/
/* There are between minCircles and maxCircles in each figure.
*/
- n = minCircles + rand() % (maxCircles - minCircles);
+ if (maxCircles == minCircles)
+ n = minCircles; /* Avoid division by zero. */
+ else
+ n = minCircles + random() % (maxCircles - minCircles);
head = NULL;
while (n--)
head = NULL;
while (n--)
@@
-534,6
+537,10
@@
check_events (void) /* X event handler [ rhess ] */
printf("re-mapped!\n");
unmapped = 0;
break;
printf("re-mapped!\n");
unmapped = 0;
break;
+
+ default:
+ screenhack_handle_event(dpy, &e);
+ break;
}
/* If we're unmapped, don't return to the caller. This
}
/* If we're unmapped, don't return to the caller. This
@@
-580,8
+587,9
@@
setup(void)
}
else
{
}
else
{
- XSelectInput(dpy, window,
- ExposureMask|ButtonPressMask|StructureNotifyMask);
+ XGetWindowAttributes (dpy, window, &xgwa);
+ XSelectInput (dpy, window,
+ xgwa.your_event_mask | ExposureMask | ButtonPressMask);
}
}
}
}
@@
-814,6
+822,7
@@
screenhack(Display *disp, Window win)
{
XSync (dpy, False);
{
XSync (dpy, False);
+ check_events();
if (holdtime)
sleep(holdtime); /* show complete figure for a bit. */
if (holdtime)
sleep(holdtime); /* show complete figure for a bit. */
@@
-821,6
+830,7
@@
screenhack(Display *disp, Window win)
}
}
+ check_events();
if (delay)
usleep (delay);
if (delay)
usleep (delay);