X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fphotopile.c;h=d2ea5b402aed92a30f06fb294eba15212bfcbcf6;hp=29617aa05ef4004d7581e0a90719dbae64bab596;hb=aa75c7476aeaa84cf3abc192b376a8b03c325213;hpb=88cfe534a698a0562e81345957a50714af1453bc diff --git a/hacks/glx/photopile.c b/hacks/glx/photopile.c index 29617aa0..d2ea5b40 100644 --- a/hacks/glx/photopile.c +++ b/hacks/glx/photopile.c @@ -21,7 +21,8 @@ "*font: " DEF_FONT "\n" \ "*desktopGrabber: xscreensaver-getimage -no-desktop %s\n" \ "*grabDesktopImages: False \n" \ - "*chooseRandomImages: True \n" + "*chooseRandomImages: True \n" \ + "*suppressRotationAnimation: True\n" \ # define refresh_photopile 0 # define release_photopile 0 @@ -30,7 +31,7 @@ #undef countof #define countof(x) (sizeof((x))/sizeof((*x))) -#ifndef HAVE_COCOA +#ifndef HAVE_JWXYZ # include /* for XrmDatabase in -debug mode */ #endif #include @@ -433,6 +434,15 @@ reshape_photopile (ModeInfo *mi, int width, int height) glLoadIdentity(); glOrtho(0, MI_WIDTH(mi), 0, MI_HEIGHT(mi), -1, 1); +# ifdef HAVE_MOBILE /* Keep it the same relative size when rotated. */ + { + GLfloat h = MI_HEIGHT(mi) / (GLfloat) MI_WIDTH(mi); + int o = (int) current_device_rotation(); + if (o != 0 && o != 180 && o != -180) + glScalef (1/h, h, 1); + } +# endif + glClear(GL_COLOR_BUFFER_BIT); } @@ -442,7 +452,7 @@ reshape_photopile (ModeInfo *mi, int width, int height) static void hack_resources (Display *dpy) { -# ifndef HAVE_COCOA +# ifndef HAVE_JWXYZ char *res = "desktopGrabber"; char *val = get_string_resource (dpy, res, "DesktopGrabber"); char buf1[255]; @@ -454,7 +464,7 @@ hack_resources (Display *dpy) value.addr = buf2; value.size = strlen(buf2); XrmPutResource (&db, buf1, "String", &value); -# endif /* !HAVE_COCOA */ +# endif /* !HAVE_JWXYZ */ }