X11 obviously doesn't use 4 bytes for a 4 bytes pixel. Rather, it uses
unsigned long, which happens to be 8 bytes these days.
gint width, height;
GdkTexture *texture;
GdkDisplay *display;
- gint n;
+ gint i, n;
if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
*p++ = height;
gdk_texture_download (texture, (guchar *) p, width * 4);
+ if (sizeof (gulong) > 4)
+ {
+ i = width * height;
+ while (i-- > 0)
+ p[i] = ((guint32 *) p)[i];
+ }
p += width * height;
n--;