X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fspotlight.c;h=cbd33f2a2e43857e584ea76f18ac583ff5214377;hb=4ade52359b6eba3621566dac79793a33aa4c915f;hp=57519e7f72105ba4178f175df1dd1822df0c9b47;hpb=de460e831dc8578acfa8b72251ab9346c99c1f96;p=xscreensaver diff --git a/hacks/spotlight.c b/hacks/spotlight.c index 57519e7f..cbd33f2a 100644 --- a/hacks/spotlight.c +++ b/hacks/spotlight.c @@ -1,6 +1,6 @@ /* * spotlight - an xscreensaver module - * Copyright (c) 1999, 2001 Rick Schultz + * Copyright (c) 1999, 2001 Rick Schultz * * loosely based on the BackSpace module "StefView" by Darcy Brockbank */ @@ -38,7 +38,7 @@ struct state { int delay; int duration; time_t start_time; - + int first_time; GC window_gc; #ifdef DEBUG GC white_gc; @@ -91,7 +91,7 @@ spotlight_init (Display *dpy, Window window) XWindowAttributes xgwa; long gcflags; Colormap cmap; - unsigned long fg, bg; + unsigned long bg; GC clip_gc; Pixmap clip_pm; @@ -104,7 +104,6 @@ spotlight_init (Display *dpy, Window window) st->sizex = xgwa.width; st->sizey = xgwa.height; cmap = xgwa.colormap; - fg = get_pixel_resource (st->dpy, cmap, "foreground", "Foreground"); bg = get_pixel_resource (st->dpy, cmap, "background", "Background"); /* read parameters, keep em sane */ @@ -139,6 +138,8 @@ spotlight_init (Display *dpy, Window window) st->pm = XCreatePixmap(st->dpy, st->window, st->sizex, st->sizey, xgwa.depth); XClearWindow(st->dpy, st->window); + st->first_time = 1; + /* create buffer to reduce flicker */ #ifdef HAVE_COCOA /* Don't second-guess Quartz's double-buffering */ st->buffer = 0; @@ -150,10 +151,6 @@ spotlight_init (Display *dpy, Window window) if (st->buffer) XFillRectangle(st->dpy, st->buffer, st->buffer_gc, 0, 0, st->sizex, st->sizey); - /* blank out screen */ - XFillRectangle(st->dpy, st->window, st->window_gc, 0, 0, st->sizex, st->sizey); - XSetWindowBackground (st->dpy, st->window, bg); - /* create clip mask (so it's a circle, not a square) */ clip_pm = XCreatePixmap(st->dpy, st->window, st->radius*4, st->radius*4, 1); st->img_loader = load_image_async_simple (0, xgwa.screen, st->window, st->pm, @@ -185,6 +182,10 @@ spotlight_init (Display *dpy, Window window) gcv.foreground = fg; st->white_gc = XCreateGC(st->dpy, st->window, gcflags, &gcv); #endif + + /* blank out screen */ + XFillRectangle(st->dpy, st->window, st->window_gc, 0, 0, st->sizex, st->sizey); + return st; } @@ -253,6 +254,12 @@ onestep (struct state *st, Bool first_p) XSetClipOrigin(st->dpy, st->buffer_gc, st->x,st->y); XCopyArea(st->dpy, st->pm, st->buffer, st->buffer_gc, st->x, st->y, st->s, st->s, st->x, st->y); + if (st->first_time) { + /* blank out screen */ + XFillRectangle(st->dpy, st->window, st->window_gc, 0, 0, st->sizex, st->sizey); + st->first_time = 0; + } + /* copy buffer to screen (window) */ XCopyArea(st->dpy, st->buffer, st->window, st->window_gc, st->x , st->y, st->s, st->s, st->x, st->y); } @@ -304,6 +311,7 @@ static const char *spotlight_defaults [] = { ".background: black", ".foreground: white", "*dontClearRoot: True", + "*fpsSolid: true", #ifdef __sgi /* really, HAVE_READ_DISPLAY_EXTENSION */ "*visualID: Best", @@ -312,6 +320,9 @@ static const char *spotlight_defaults [] = { "*delay: 10000", "*duration: 120", "*radius: 125", +#ifdef USE_IPHONE + "*ignoreRotation: True", +#endif 0 };