X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fripples.c;h=76586488be5900b1fea18bba359c48f6cdbb06e1;hb=refs%2Fremotes%2Fgithub%2Fmaster2;hp=e030b1cd1d85f7cba8715e7f7b888803d000983d;hpb=50be9bb40dc60130c99ffa568e6677779904ff70;p=xscreensaver diff --git a/hacks/ripples.c b/hacks/ripples.c index e030b1cd..76586488 100644 --- a/hacks/ripples.c +++ b/hacks/ripples.c @@ -62,6 +62,7 @@ struct state { XImage *orig_map, *buffer_map; int ctab[256]; Colormap colormap; + Screen *screen; int ncolors; int light; @@ -495,6 +496,7 @@ setup_X(struct state *st) XGetWindowAttributes(st->dpy, st->window, &xgwa); depth = xgwa.depth; st->colormap = xgwa.colormap; + st->screen = xgwa.screen; st->bigwidth = xgwa.width; st->bigheight = xgwa.height; st->visual = xgwa.visual; @@ -531,7 +533,7 @@ setup_X(struct state *st) st->img_loader = load_image_async_simple (0, xgwa.screen, st->window, st->window, 0, 0); - st->start_time = time ((time_t) 0); + st->start_time = time ((time_t *) 0); } else { XGCValues gcv; @@ -656,7 +658,8 @@ init_oily_colors(struct state *st) if (!mono_p) { colors = (XColor *)malloc(sizeof(*colors) * (st->ncolors+1)); - make_smooth_colormap(st->dpy, st->visual, st->colormap, colors, &st->ncolors, + make_smooth_colormap(st->screen, st->visual, st->colormap, + colors, &st->ncolors, True, /* allocate */ False, /* not writable */ True); /* verbose (complain about failure) */ @@ -1030,7 +1033,7 @@ ripples_draw (Display *dpy, Window window, void *closure) if (! st->img_loader) { /* just finished */ XWindowAttributes xgwa; XGetWindowAttributes(st->dpy, st->window, &xgwa); - st->start_time = time ((time_t) 0); + st->start_time = time ((time_t *) 0); st->orig_map = XGetImage (st->dpy, st->window, 0, 0, xgwa.width, xgwa.height, ~0L, ZPixmap); @@ -1040,12 +1043,12 @@ ripples_draw (Display *dpy, Window window, void *closure) } if (!st->img_loader && - st->start_time + st->duration < time ((time_t) 0)) { + st->start_time + st->duration < time ((time_t *) 0)) { XWindowAttributes xgwa; XGetWindowAttributes(st->dpy, st->window, &xgwa); st->img_loader = load_image_async_simple (0, xgwa.screen, st->window, st->window, 0, 0); - st->start_time = time ((time_t) 0); + st->start_time = time ((time_t *) 0); return st->delay; } @@ -1074,6 +1077,12 @@ ripples_reshape (Display *dpy, Window window, void *closure, static Bool ripples_event (Display *dpy, Window window, void *closure, XEvent *event) { + struct state *st = (struct state *) closure; + if (screenhack_event_helper (dpy, window, event)) + { + st->start_time = 0; + return True; + } return False; } @@ -1104,6 +1113,10 @@ static const char *ripples_defaults[] = "*useSHM: True", #else "*useSHM: False", +#endif +#ifdef USE_IPHONE + "*ignoreRotation: True", + "*rotateImages: True", #endif 0 };