-# ifdef HAVE_XSHM_EXTENSION
- if (use_shm)
- {
- Visual *visual = DefaultVisualOfScreen (screen);
- server_ximage = create_xshm_image (dpy, visual, depth,
- ZPixmap, 0, &shm_info,
- width, height);
- if (server_ximage)
- XShmGetImage (dpy, pixmap, server_ximage, 0, 0, ~0L);
- else
- use_shm = False;
- }
-# endif /* HAVE_XSHM_EXTENSION */
-
- if (!server_ximage)
- server_ximage = XGetImage (dpy, pixmap, 0, 0, width, height, ~0L, ZPixmap);
+ server_ximage = create_xshm_image (dpy, visual, depth, ZPixmap, &shm_info,
+ width, height);
+ get_xshm_image (dpy, pixmap, server_ximage, 0, 0, ~0L, &shm_info);