X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fimsmap.c;h=1877243dcf00c2bce88dddb93a0fda7871f73fe1;hb=aa75c7476aeaa84cf3abc192b376a8b03c325213;hp=6e1f31dded435a8f7bbc437cc2dead2c62546155;hpb=6b1c86cf395f59389e4ece4ea8f4bea2c332745b;p=xscreensaver diff --git a/hacks/imsmap.c b/hacks/imsmap.c index 6e1f31dd..1877243d 100644 --- a/hacks/imsmap.c +++ b/hacks/imsmap.c @@ -1,4 +1,4 @@ -/* imsmap, Copyright (c) 1992-2008 Juergen Nickelsen and Jamie Zawinski. +/* imsmap, Copyright (c) 1992-2013 Juergen Nickelsen and Jamie Zawinski. * Derived from code by Markus Schirmer, TU Berlin. * * Permission to use, copy, modify, distribute, and sell this software and its @@ -161,6 +161,9 @@ init_map (struct state *st) if (mono_p) st->flip_xy = 0; + else if (st->colors) + free_colors (st->xgwa.screen, st->cmap, st->colors, st->ncolors); + st->colors = 0; st->ncolors = get_integer_resource (st->dpy, "ncolors", "Integer"); st->delay = get_integer_resource (st->dpy, "delay", "Integer"); @@ -183,12 +186,10 @@ init_map (struct state *st) if (!mono_p) { - if (st->colors) - free_colors (st->dpy, st->cmap, st->colors, st->ncolors); - else - st->colors = (XColor *) malloc (st->ncolors * sizeof(*st->colors)); + if (st->ncolors < 1) st->ncolors = 1; + st->colors = (XColor *) malloc (st->ncolors * sizeof(*st->colors)); - make_smooth_colormap (st->dpy, st->xgwa.visual, st->cmap, + make_smooth_colormap (st->xgwa.screen, st->xgwa.visual, st->cmap, st->colors, &st->ncolors, True, 0, False); if (st->ncolors <= 2) @@ -372,7 +373,7 @@ static Bool imsmap_event (Display *dpy, Window window, void *closure, XEvent *event) { struct state *st = (struct state *) closure; - if (event->xany.type == ButtonPress) + if (screenhack_event_helper (dpy, window, event)) { init_map (st); return True; @@ -395,11 +396,15 @@ imsmap_free (Display *dpy, Window window, void *closure) static const char *imsmap_defaults [] = { ".background: #000066", ".foreground: #FF00FF", + "*fpsSolid: true", "*mode: random", "*ncolors: 50", "*iterations: 7", "*delay: 5", "*delay2: 20000", +#ifdef HAVE_MOBILE + "*ignoreRotation: True", +#endif 0 }; @@ -412,4 +417,4 @@ static XrmOptionDescRec imsmap_options [] = { { 0, 0, 0, 0 } }; -XSCREENSAVER_MODULE ("IMSMAP", imsmap) +XSCREENSAVER_MODULE ("IMSMap", imsmap)