X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fspotlight.c;h=eebe5f3775ec749b89c534ab8947726a200195f6;hb=96a411663168b0ba5432b407a83be55f3df0c802;hp=8c76fc74e7faa698e036d0f5f0384f83b3fc03f3;hpb=c596d1306f5f92f7eab76224d3b049980a14adcb;p=xscreensaver diff --git a/hacks/spotlight.c b/hacks/spotlight.c index 8c76fc74..eebe5f37 100644 --- a/hacks/spotlight.c +++ b/hacks/spotlight.c @@ -1,6 +1,6 @@ /* * spotlight - an xscreensaver module - * Copyright (c) 1999 Rick Schultz + * Copyright (c) 1999, 2001 Rick Schultz * * loosely based on the BackSpace module "StefView" by Darcy Brockbank */ @@ -93,6 +93,10 @@ init_hack (Display *dpy, Window window) 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; @@ -105,14 +109,11 @@ init_hack (Display *dpy, Window window) #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, NULL); + XClearWindow(dpy, window); + XFlush (dpy); /* create buffer to reduce flicker */ buffer = XCreatePixmap(dpy, window, sizex, sizey, xgwa.depth); @@ -213,6 +214,8 @@ onestep (Display *dpy, Window window) char *progclass = "Spotlight"; char *defaults [] = { + ".background: black", + ".foreground: white", "*dontClearRoot: True", #ifdef __sgi /* really, HAVE_READ_DISPLAY_EXTENSION */