From http://www.jwz.org/xscreensaver/xscreensaver-5.22.tar.gz
[xscreensaver] / hacks / piecewise.c
index 336dd5120e69d1a3afc6b8ef4d3679a43f886d18..9cfbefdf70c283e581e10aeb9fa92dbae50d51df 100644 (file)
@@ -861,7 +861,9 @@ piecewise_init (Display *dd, Window ww)
       st->colors[0].pixel = get_pixel_resource(st->dpy, st->xgwa.colormap, "foreground", "Foreground");
     }
   else {
-    make_color_loop(st->dpy, st->xgwa.colormap, 0, 1, 1, 120, 1, 1, 240, 1, 1, st->colors, &st->ncolors, True, False);
+    make_color_loop(st->xgwa.screen, st->xgwa.visual, st->xgwa.colormap,
+                    0, 1, 1, 120, 1, 1, 240, 1, 1,
+                    st->colors, &st->ncolors, True, False);
     if (st->ncolors < 2)
       goto MONO; 
     }
@@ -940,6 +942,8 @@ static void
 piecewise_reshape (Display *dpy, Window window, void *closure, 
                  unsigned int w, unsigned int h)
 {
+  struct state *st = (struct state *) closure;
+  XGetWindowAttributes(st->dpy, st->window, &st->xgwa);
 }
 
 static Bool
@@ -973,6 +977,9 @@ static const char *piecewise_defaults [] = {
 #ifdef HAVE_DOUBLE_BUFFER_EXTENSION
   "*useDBE:             True",
 #endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
+#ifdef USE_IPHONE
+  "*ignoreRotation:     True",
+#endif
   0
   };