View | Details | Raw Unified | Return to bug 807205
Collapse All | Expand All

(-)a/src/glx/drisw_glx.c (-4 / +5 lines)
Lines 209-215 swrastPutImage(__DRIdrawable * draw, int op, Link Here
209
   ximage->data = NULL;
209
   ximage->data = NULL;
210
}
210
}
211
211
212
static int shm_error;
212
static int shm_error = 0;
213
213
214
static int
214
static int
215
shm_handler(Display *d, XErrorEvent *e)
215
shm_handler(Display *d, XErrorEvent *e)
Lines 243-249 swrastShmGetImage(__DRIdrawable *read, char *data, struct drisw_drawable *prp) Link Here
243
    XShmSegmentInfo seg = { 0, -1, (void *)-1, 0 };
243
    XShmSegmentInfo seg = { 0, -1, (void *)-1, 0 };
244
    int (*old_handler)(Display *, XErrorEvent *);
244
    int (*old_handler)(Display *, XErrorEvent *);
245
245
246
    if (!XShmQueryExtension(dpy))
246
    if (shm_error || !XShmQueryExtension(dpy))
247
	goto out;
247
	goto out;
248
248
249
    /* image setup */
249
    /* image setup */
Lines 290-297 swrastShmGetImage(__DRIdrawable *read, char *data, struct drisw_drawable *prp) Link Here
290
out:
290
out:
291
    ximage->obdata = NULL;
291
    ximage->obdata = NULL;
292
    ximage->data = NULL;
292
    ximage->data = NULL;
293
    shm_error = 0;
293
    if (shm_error == 0) 
294
    XShmDetach(dpy, &seg);
294
	XShmDetach(dpy, &seg);
295
    if (seg.shmaddr != (void *)-1)
295
    if (seg.shmaddr != (void *)-1)
296
	shmdt(seg.shmaddr);
296
	shmdt(seg.shmaddr);
297
    if (seg.shmid > -1)
297
    if (seg.shmid > -1)
Lines 322-327 swrastGetImage(__DRIdrawable * read, Link Here
322
      return;
322
      return;
323
323
324
   /* shm failed, fall back to protocol */
324
   /* shm failed, fall back to protocol */
325
   XSync(dpy, 0);
325
   ximage->data = data;
326
   ximage->data = data;
326
327
327
   XGetSubImage(dpy, readable, x, y, w, h, ~0L, ZPixmap, ximage, 0, 0);
328
   XGetSubImage(dpy, readable, x, y, w, h, ~0L, ZPixmap, ximage, 0, 0);

Return to bug 807205