From http://www.jwz.org/xscreensaver/xscreensaver-5.35.tar.gz
[xscreensaver] / hacks / flame.c
index eed6287cefd3a6141475b8100533527789d6fb8a..7b590563f20c4eb249a2630ced15fd2a2f322612 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1993-2008 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1993-2014 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -151,7 +151,8 @@ flame_init (Display *dpy, Window window)
       st->ncolors = get_integer_resource (st->dpy, "colors", "Integer");
       if (st->ncolors <= 0) st->ncolors = 128;
       st->colors = (XColor *) malloc ((st->ncolors+1) * sizeof (*st->colors));
-      make_smooth_colormap (st->dpy, xgwa.visual, xgwa.colormap, st->colors, &st->ncolors,
+      make_smooth_colormap (xgwa.screen, xgwa.visual, xgwa.colormap,
+                            st->colors, &st->ncolors,
                            True, 0, True);
       if (st->ncolors <= 2)
        mono_p = True, st->ncolors = 0;
@@ -203,7 +204,7 @@ recurse (struct state *st, double x, double y, int l, Display *dpy, Window win)
             "I think this happens on HPUX.  I think it's non-IEEE
             to generate an exception instead of a silent NaN."
           */
-         if ((abs(x) > 1.0E5) || (abs(y) > 1.0E5))
+         if ((fabs(x) > 1.0E5) || (fabs(y) > 1.0E5))
            x = x / y;
 
          nx = st->f[0][0][i] * x + st->f[0][1][i] * y + st->f[0][2][i];
@@ -418,6 +419,9 @@ static const char *flame_defaults [] = {
   "*delay:     50000",
   "*delay2:    2000000",
   "*points:    10000",
+#ifdef HAVE_MOBILE
+  "*ignoreRotation: True",
+#endif
   0
 };
 
@@ -442,6 +446,12 @@ flame_reshape (Display *dpy, Window window, void *closure,
 static Bool
 flame_event (Display *dpy, Window window, void *closure, XEvent *event)
 {
+  struct state *st = (struct state *) closure;
+  if (screenhack_event_helper (dpy, window, event))
+    {
+      st->do_reset = 1;
+      return True;
+    }
   return False;
 }