- st->buffer_map = 0;
-
-#ifdef HAVE_XSHM_EXTENSION
- if (st->use_shm) {
- st->buffer_map = create_xshm_image(st->dpy, xgwa.visual, depth,
- ZPixmap, 0, &st->shm_info, st->width, st->height);
- if (!st->buffer_map) {
- st->use_shm = False;
- fprintf(stderr, "create_xshm_image failed\n");
- }
- }
-#endif /* HAVE_XSHM_EXTENSION */
-
- if (!st->buffer_map) {
- st->buffer_map = XCreateImage(st->dpy, xgwa.visual,
- depth, ZPixmap, 0, 0, st->width, st->height, 8, 0);
- st->buffer_map->data = (char *)calloc (st->buffer_map->height,
- st->buffer_map->bytes_per_line);
- }
+ st->buffer_map = create_xshm_image(st->dpy, xgwa.visual, depth,
+ ZPixmap, &st->shm_info, st->width, st->height);