* to get pleasing figures.
*/
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*colors: 100",
"*color0: red",
"*delay: 1000",
/* 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--)
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
}
else
{
- XSelectInput(dpy, window,
- ExposureMask|ButtonPressMask|StructureNotifyMask);
+ XWindowAttributes xgwa;
+ XGetWindowAttributes (dpy, window, &xgwa);
+ XSelectInput (dpy, window,
+ xgwa.your_event_mask | ExposureMask |
+ ButtonPressMask |StructureNotifyMask);
}
}
{
XSync (dpy, False);
+ check_events();
if (holdtime)
sleep(holdtime); /* show complete figure for a bit. */
}
+ check_events();
if (delay)
usleep (delay);