/*
* spotlight - an xscreensaver module
- * Copyright (c) 1999, 2001 Rick Schultz <rick@skapunx.net>
+ * Copyright (c) 1999, 2001 Rick Schultz <rick.schultz@gmail.com>
*
* loosely based on the BackSpace module "StefView" by Darcy Brockbank
*/
int delay;
int duration;
time_t start_time;
-
+ int first_time;
GC window_gc;
#ifdef DEBUG
GC white_gc;
XWindowAttributes xgwa;
long gcflags;
Colormap cmap;
- unsigned long fg, bg;
+ unsigned long bg;
GC clip_gc;
Pixmap clip_pm;
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 */
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;
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,
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;
}
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);
}
"*delay: 10000",
"*duration: 120",
"*radius: 125",
+#ifdef USE_IPHONE
+ "*ignoreRotation: True",
+#endif
0
};