glx: Deliver an xlib style error to the application from an XCB error
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 12 Dec 2011 17:54:25 +0000 (09:54 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 23 Dec 2011 16:40:30 +0000 (08:40 -0800)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
src/glx/glx_error.c
src/glx/glx_error.h

index 0855c35951a4e00923416f789c8b70f270fac913..b3860db2e3745bb64f0be8999b6b1b90cd0cbfde 100644 (file)
@@ -65,3 +65,22 @@ __glXSendError(Display * dpy, int_fast8_t errorCode, uint_fast32_t resourceID,
 
    UnlockDisplay(dpy);
 }
+
+void
+__glXSendErrorForXcb(Display * dpy, const xcb_generic_error_t *err)
+{
+   xError error;
+
+   LockDisplay(dpy);
+
+   error.type = X_Error;
+   error.errorCode = err->error_code;
+   error.sequenceNumber = err->sequence;
+   error.resourceID = err->resource_id;
+   error.minorCode = err->minor_code;
+   error.majorCode = err->major_code;
+
+   _XError(dpy, &error);
+
+   UnlockDisplay(dpy);
+}
index 19be38b44253b68ecff93b6f0c8e1c779e023bb4..eaf6b814c5e46b4a198d1979c2ed3c1c2aea84ce 100644 (file)
 #include <stdbool.h>
 #include <stdint.h>
 #include <X11/Xlib.h>
+#include <xcb/xcb.h>
 
 void __glXSendError(Display * dpy, int_fast8_t errorCode,
                    uint_fast32_t resourceID, uint_fast16_t minorCode,
                    bool coreX11error);
+
+_X_HIDDEN void __glXSendErrorForXcb(Display * dpy,
+                                   const xcb_generic_error_t *err);