From http://www.jwz.org/xscreensaver/xscreensaver-5.30.tar.gz
[xscreensaver] / hacks / ccurve.c
index 9e7e2de3ca53e197a0c03958a2cd5beb1e5624c2..057fed0b256a4aca37c03664da60e9f975a46c7a 100644 (file)
@@ -701,7 +701,8 @@ ccurve_init (Display *dpy, Window window)
     st->context = XCreateGC (st->dpy, st->window, GCForeground | GCBackground,
                         &values);
     st->color_count = MAXIMUM_COLOR_COUNT;
-    make_color_loop (st->dpy, st->color_map,
+    make_color_loop (hack_attributes.screen, hack_attributes.visual,
+                     st->color_map,
                     0,   1, 1,
                     120, 1, 1,
                     240, 1, 1,
@@ -813,11 +814,25 @@ static void
 ccurve_reshape (Display *dpy, Window window, void *closure, 
                  unsigned int w, unsigned int h)
 {
+  struct state *st = (struct state *) closure;
+  XWindowAttributes xgwa;
+  st->width = w;
+  st->height = h;
+  XGetWindowAttributes (st->dpy, st->window, &xgwa);
+  XFreePixmap (dpy, st->pixmap);
+  st->pixmap = XCreatePixmap (st->dpy, st->window, st->width, st->height,
+                              xgwa.depth);
 }
 
 static Bool
 ccurve_event (Display *dpy, Window window, void *closure, XEvent *event)
 {
+  struct state *st = (struct state *) closure;
+  if (screenhack_event_helper (dpy, window, event))
+    {
+      st->draw_index = 0;
+      return True;
+    }
   return False;
 }
 
@@ -834,6 +849,9 @@ static const char *ccurve_defaults [] =
     ".delay:      3",
     ".pause:      0.4",
     ".limit: 200000",
+#ifdef USE_IPHONE
+    "*ignoreRotation: True",
+#endif
     0
 };