From http://www.jwz.org/xscreensaver/xscreensaver-5.22.tar.gz
[xscreensaver] / hacks / halftone.c
index 7c62111ac360287add996736c1f43df46408b592..84503c1fc77ee07d90109429886b1664e79d4d3a 100644 (file)
@@ -78,7 +78,7 @@ static void update_buffer(halftone_screen *halftone, XWindowAttributes * attrs)
     if (halftone->buffer_width != -1 &&
        halftone->buffer_height != -1)
     {
-      if (halftone->buffer == halftone->window)
+      if (halftone->buffer != halftone->window)
         XFreePixmap(halftone->dpy, halftone->buffer);
       XFreeGC(halftone->dpy, halftone->buffer_gc);
     }
@@ -191,7 +191,7 @@ halftone_init (Display *dpy, Window window)
   halftone->ncolors = get_integer_resource (dpy, "colors", "Colors");
   if (halftone->ncolors < 4) halftone->ncolors = 4;
   halftone->colors = (XColor *) calloc(halftone->ncolors, sizeof(XColor));
-  make_smooth_colormap (dpy, attrs.visual, attrs.colormap,
+  make_smooth_colormap (attrs.screen, attrs.visual, attrs.colormap,
                         halftone->colors, &halftone->ncolors,
                         True, 0, False);
   halftone->color0 = 0;
@@ -373,6 +373,9 @@ static const char *halftone_defaults [] = {
   "*sizeFactor:                1.5",
   "*colors:            200",
   "*cycleSpeed:                10",
+#ifdef USE_IPHONE
+  "*ignoreRotation:     True",
+#endif
   0
 };