X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fgrab-ximage.c;h=49e7a8e7d0fca228119fec6fc56ea958c645b0ee;hb=d6b0217f2417bd19187f0ebc389d6c5c2233b11c;hp=5127b494a6136a5be847c1993f95d4f32d0f8757;hpb=8afc01a67be4fbf3f1cc0fce9adf01b5289a21c6;p=xscreensaver diff --git a/hacks/glx/grab-ximage.c b/hacks/glx/grab-ximage.c index 5127b494..49e7a8e7 100644 --- a/hacks/glx/grab-ximage.c +++ b/hacks/glx/grab-ximage.c @@ -18,7 +18,11 @@ #include #include -#ifdef HAVE_COCOA +#ifdef HAVE_ANDROID +#include +#endif + +#ifdef HAVE_JWXYZ # include "jwxyz.h" # ifndef HAVE_JWZGLES # include @@ -70,7 +74,7 @@ extern char *progname; #include -#ifdef HAVE_COCOA +#ifdef HAVE_JWXYZ # include "jwxyz.h" #else # include @@ -155,10 +159,10 @@ convert_ximage_to_rgba32 (Screen *screen, XImage *image) */ XImage *from = image; XImage *to = XCreateImage (dpy, visual, 32, /* depth */ - ZPixmap, 0, 0, from->width, from->height + 2, + ZPixmap, 0, 0, from->width, from->height, 32, /* bitmap pad */ 0); - to->data = (char *) calloc (to->height, to->bytes_per_line); + to->data = (char *) calloc (to->height + 2, to->bytes_per_line); /* Set the bit order in the XImage structure to whatever the local host's native bit order is. @@ -731,7 +735,7 @@ load_texture_async_cb (Screen *screen, Window window, Drawable drawable, if (geometry->width <= 0 || geometry->height <= 0) { /* This can happen if an old version of xscreensaver-getimage - is installed. */ + is installed. Or if we have no image (checkerboard). */ geometry->x = 0; geometry->y = 0; geometry->width = dd.pix_width;