/*
* spotlight - an xscreensaver module
- * Copyright (c) 1999 Rick Schultz <rick@skapunx.net>
+ * Copyright (c) 1999, 2001 Rick Schultz <rick@skapunx.net>
*
* loosely based on the BackSpace module "StefView" by Darcy Brockbank
*/
radius = get_integer_resource ("radius", "Integer");
if (radius < 0) radius = 125;
+ /* Don't let the spotlight be bigger than 1/4 of the window */
+ if (radius > xgwa.width / 4) radius = xgwa.width / 4;
+ if (radius > xgwa.height / 4) radius = xgwa.height / 4;
+
/* do the dance */
gcv.function = GXcopy;
gcv.subwindow_mode = IncludeInferiors;
#endif
window_gc = XCreateGC(dpy, window, gcflags, &gcv);
-
- /* grab screen to window */
- grab_screen_image(xgwa.screen, window);
-
- /* save screen to pixmap for copying later */
+ /* grab screen to pixmap */
pm = XCreatePixmap(dpy, window, sizex, sizey, xgwa.depth);
- XCopyArea(dpy, window, pm, window_gc, 0, 0, sizex, sizey, 0, 0);
-
+ load_random_image (xgwa.screen, window, pm);
+ XClearWindow(dpy, window);
+ XFlush (dpy);
/* create buffer to reduce flicker */
buffer = XCreatePixmap(dpy, window, sizex, sizey, xgwa.depth);
buffer_gc = XCreateGC(dpy, buffer, gcflags, &gcv);
+ XFillRectangle(dpy, buffer, buffer_gc, 0, 0, sizex, sizey);
/* blank out screen */
XFillRectangle(dpy, window, window_gc, 0, 0, sizex, sizey);
char *progclass = "Spotlight";
char *defaults [] = {
+ ".background: black",
+ ".foreground: white",
"*dontClearRoot: True",
#ifdef __sgi /* really, HAVE_READ_DISPLAY_EXTENSION */