diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index 9d3bfeb31b9..bef171c1ebd 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -863,9 +863,16 @@ check_xshm(Display *dpy) xcb_void_cookie_t cookie; xcb_generic_error_t *error; int ret = True; - int ignore; + xcb_query_extension_cookie_t shm_cookie; + xcb_query_extension_reply_t *shm_reply; + bool has_mit_shm; - if (!XQueryExtension(dpy, "MIT-SHM", &xshm_opcode, &ignore, &ignore)) + shm_cookie = xcb_query_extension(c, 7, "MIT-SHM"); + shm_reply = xcb_query_extension_reply(c, shm_cookie, NULL); + + has_mit_shm = shm_reply->present; + free(shm_reply); + if (!has_mit_shm) return False; cookie = xcb_shm_detach_checked(c, 0);