From http://www.jwz.org/xscreensaver/xscreensaver-5.22.tar.gz
[xscreensaver] / hacks / slidescreen.c
index a3859b573eded9084152b4093890463d29773d00..23c990c296d13c66bc461a9847919b53e496623c 100644 (file)
@@ -47,7 +47,6 @@ slidescreen_init (Display *dpy, Window window)
 {
   struct state *st = (struct state *) calloc (1, sizeof(*st));
   XWindowAttributes xgwa;
-  Visual *visual;
   XGCValues gcv;
   long gcflags;
 
@@ -58,7 +57,6 @@ slidescreen_init (Display *dpy, Window window)
                                             st->window, 0, 0);
   st->start_time = time ((time_t) 0);
 
-  visual = xgwa.visual;
   st->max_width = xgwa.width;
   st->max_height = xgwa.height;
 
@@ -427,6 +425,16 @@ static void
 slidescreen_reshape (Display *dpy, Window window, void *closure, 
                  unsigned int w, unsigned int h)
 {
+  struct state *st = (struct state *) closure;
+  st->max_width = w;
+  st->max_height = h;
+  if (! st->img_loader) {
+    XWindowAttributes xgwa;
+    XGetWindowAttributes (st->dpy, st->window, &xgwa);
+    st->img_loader = load_image_async_simple (0, xgwa.screen, st->window,
+                                              st->window, 0, 0);
+    st->start_time = time ((time_t) 0);
+  }
 }
 
 static Bool
@@ -447,6 +455,7 @@ slidescreen_free (Display *dpy, Window window, void *closure)
 
 static const char *slidescreen_defaults [] = {
   "*dontClearRoot:             True",
+  "*fpsSolid:                  true",
 
 #ifdef __sgi   /* really, HAVE_READ_DISPLAY_EXTENSION */
   "*visualID:                  Best",
@@ -460,6 +469,9 @@ static const char *slidescreen_defaults [] = {
   "*delay:                     50000",
   "*delay2:                    1000000",
   "*duration:                  120",
+#ifdef USE_IPHONE
+  "*ignoreRotation:             True",
+#endif
   0
 };
 
@@ -473,4 +485,4 @@ static XrmOptionDescRec slidescreen_options [] = {
   { 0, 0, 0, 0 }
 };
 
-XSCREENSAVER_MODULE ("Slidescreen", slidescreen)
+XSCREENSAVER_MODULE ("SlideScreen", slidescreen)