From 1ab55e6ba1d1faed4efa5bf82e311de41964105b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 6 Nov 2015 18:13:05 +0100 Subject: [PATCH] xlib: fix mixing xcb & xlib calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NextRequest is a macro that doesn't mix well with xcb, since dpy->request is not updated. Instead use XNextRequest() that was fixed to do the right thing with xcb in libX11 commit: http://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=7f8f9a36ef901f31279c385caf960a22daeb33fe This may solve application X errors when a shmdt() is called by cairo before the Attach request is processed. Signed-off-by: Marc-André Lureau --- src/cairo-xlib-surface-shm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cairo-xlib-surface-shm.c b/src/cairo-xlib-surface-shm.c index 3187223..a339d0c 100644 --- a/src/cairo-xlib-surface-shm.c +++ b/src/cairo-xlib-surface-shm.c @@ -441,7 +441,7 @@ static void send_event(cairo_xlib_display_t *display, ev.type = display->shm->event; ev.send_event = 1; /* XXX or lie? */ - ev.serial = NextRequest (display->display); + ev.serial = XNextRequest (display->display); ev.drawable = display->shm->window; ev.major_code = display->shm->opcode; ev.minor_code = X_ShmPutImage; @@ -599,7 +599,7 @@ _cairo_xlib_shm_pool_create(cairo_xlib_display_t *display, goto cleanup; } - pool->attached = NextRequest (dpy); + pool->attached = XNextRequest (dpy); success = XShmAttach (dpy, &pool->shm); #if !IPC_RMID_DEFERRED_RELEASE XSync (dpy, FALSE); @@ -1200,7 +1200,7 @@ _cairo_xlib_shm_surface_mark_active (cairo_surface_t *_shm) cairo_xlib_shm_surface_t *shm = (cairo_xlib_shm_surface_t *) _shm; cairo_xlib_display_t *display = (cairo_xlib_display_t *) _shm->device; - shm->active = NextRequest (display->display); + shm->active = XNextRequest (display->display); } void @@ -1242,7 +1242,7 @@ _cairo_xlib_shm_surface_get_obdata (cairo_surface_t *surface) cairo_xlib_display_t *display = (cairo_xlib_display_t *) surface->device; cairo_xlib_shm_surface_t *shm = (cairo_xlib_shm_surface_t *) surface; - display->shm->last_event = shm->active = NextRequest (display->display); + display->shm->last_event = shm->active = XNextRequest (display->display); return &shm->info->pool->shm; } -- 2.5.0