X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fepicycle.c;h=91a47a28ee93489cca060e3f2dce3795595cf5e3;hb=aa75c7476aeaa84cf3abc192b376a8b03c325213;hp=004c0ea56a1a9d123efc4a1ebc0b7dc52e81230e;hpb=50be9bb40dc60130c99ffa568e6677779904ff70;p=xscreensaver diff --git a/hacks/epicycle.c b/hacks/epicycle.c index 004c0ea5..91a47a28 100644 --- a/hacks/epicycle.c +++ b/hacks/epicycle.c @@ -65,6 +65,9 @@ static const char *epicycle_defaults [] = { "*divisorPoisson: 0.4", "*sizeFactorMin: 1.05", "*sizeFactorMax: 2.05", +#ifdef HAVE_MOBILE + "*ignoreRotation: True", +#endif 0 }; @@ -401,7 +404,7 @@ colour_init(struct state *st, XWindowAttributes *pxgwa) */ if (st->colors) { - free_colors(st->dpy, st->cmap, st->colors, st->ncolors); + free_colors(pxgwa->screen, st->cmap, st->colors, st->ncolors); st->colors = 0; st->ncolors = 0; } @@ -421,7 +424,8 @@ colour_init(struct state *st, XWindowAttributes *pxgwa) st->colors = (XColor *) malloc(sizeof(*st->colors) * (st->ncolors+1)); if (!st->colors) abort(); - make_smooth_colormap (st->dpy, pxgwa->visual, st->cmap, st->colors, &st->ncolors, + make_smooth_colormap (pxgwa->screen, pxgwa->visual, st->cmap, + st->colors, &st->ncolors, True, /* allocate */ False, /* not writable */ True); /* verbose (complain about failure) */ @@ -719,7 +723,7 @@ epicycle_draw (Display *dpy, Window window, void *closure) st->L = compute_divisor_lcm(st->pb0->epicycles); - st->colour_cycle_rate = fabs(st->L); + st->colour_cycle_rate = labs(st->L); st->xtime = fabs(st->L * st->circle / st->wdot_max); @@ -760,7 +764,7 @@ static Bool epicycle_event (Display *dpy, Window window, void *closure, XEvent *e) { struct state *st = (struct state *) closure; - if (e->type == ButtonPress) + if (screenhack_event_helper (dpy, window, e)) { st->restart = 1; return True;