- swirl->ximage = XCreateImage(dpy, swirl->visual, swirl->rdepth, ZPixmap,
- 0, 0, swirl->width, swirl->height,
- 8, 0);
- swirl->ximage->data = swirl->image =
- (unsigned char *) calloc(swirl->height, swirl->ximage->bytes_per_line);
+ swirl->ximage = 0;
+#ifdef HAVE_XSHM_EXTENSION
+ if (mi->use_shm)
+ {
+ swirl->ximage = create_xshm_image(dpy, swirl->visual, swirl->rdepth,
+ ZPixmap, 0, &mi->shm_info,
+ swirl->width, swirl->height);
+ if (!swirl->ximage)
+ mi->use_shm = False;
+ }
+#endif /* HAVE_XSHM_EXTENSION */
+
+ if (!swirl->ximage)
+ {
+ swirl->ximage = XCreateImage(dpy, swirl->visual, swirl->rdepth, ZPixmap,
+ 0, 0, swirl->width, swirl->height,
+ 8, 0);
+ swirl->image = (unsigned char *)
+ calloc(swirl->height, swirl->ximage->bytes_per_line);
+ swirl->ximage->data = (char *) swirl->image;
+ }