- if (it->use_shm) {
-#ifdef HAVE_XSHM_EXTENSION
- it->image=create_xshm_image(it->dpy, it->xgwa.visual, it->xgwa.depth, ZPixmap, 0,
- &it->shm_info,
- width / bits_per_pixel, it->useheight);
-#endif
- if (!it->image) it->use_shm=0;
- }
- if (!it->image) {
- it->image = XCreateImage(it->dpy, it->xgwa.visual, it->xgwa.depth, ZPixmap, 0, 0,
- it->usewidth, it->useheight, 8, width / 8);
- if (it->image) {
- if(thread_malloc((void **)&it->image->data, it->dpy,
- it->image->height * it->image->bytes_per_line)) {
- it->image->data = NULL;
- XDestroyImage(it->image);
- it->image = NULL;
- }
- }
- }
+ it->image=create_xshm_image(it->dpy, it->xgwa.visual, it->xgwa.depth,
+ ZPixmap, &it->shm_info,
+ width / bits_per_pixel, it->useheight);