X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fepicycle.c;h=01e88d381e3342e594bd077886483d938ec1dca3;hb=e4fa2ac140f7bc56571373a7b7eb585fa4500e38;hp=addaaaaf4365253deca7bfded1ab504660d2e797;hpb=c6b273ef7292ba10943694df1656b05203d7b62f;p=xscreensaver diff --git a/hacks/epicycle.c b/hacks/epicycle.c index addaaaaf..01e88d38 100644 --- a/hacks/epicycle.c +++ b/hacks/epicycle.c @@ -50,8 +50,8 @@ char *progclass="Epicycle"; * to get pleasing figures. */ char *defaults [] = { - "*background: black", - "*foreground: white", + ".background: black", + ".foreground: white", "*colors: 100", "*color0: red", "*delay: 1000", @@ -266,7 +266,10 @@ new_circle_chain(void) /* 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--) @@ -534,6 +537,10 @@ check_events (void) /* X event handler [ rhess ] */ 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 @@ -580,8 +587,9 @@ setup(void) } 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); + check_events(); 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);