From http://www.jwz.org/xscreensaver/xscreensaver-5.22.tar.gz
[xscreensaver] / hacks / distort.c
index 92cc0de32b7e801369ff93b5916e32cb084fcc11..8173c43b96bcdc61a1ff92217abc3b2cc52e5003 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- mode: C; tab-width: 4 -*-
- * xscreensaver, Copyright (c) 1992-2008 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1992-2013 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
@@ -785,8 +785,9 @@ distort_reshape (Display *dpy, Window window, void *closure,
   XGetWindowAttributes (st->dpy, st->window, &st->xgwa);
   /* XClearWindow (dpy, window); */
   /* Why doesn't this work? */
-  XPutImage (st->dpy, st->window, st->gc, st->orig_map,
-             0, 0, st->orig_map->width, st->orig_map->height, 0, 0);
+  if (st->orig_map)  /* created in distort_finish_loading, might be early */
+    XPutImage (st->dpy, st->window, st->gc, st->orig_map,
+               0, 0, st->orig_map->width, st->orig_map->height, 0, 0);
 }
 
 static Bool
@@ -833,6 +834,9 @@ static const char *distort_defaults [] = {
 #ifdef HAVE_XSHM_EXTENSION
        "*useSHM:                       False",         /* xshm turns out not to help. */
 #endif /* HAVE_XSHM_EXTENSION */
+#ifdef USE_IPHONE
+  "*ignoreRotation:     True",
+#endif
        0
 };