glx: Deliver an xlib style error to the application from an XCB error

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Ian Romanick 2011-12-12 09:54:25 -08:00
parent efa93ae449
commit fba400072f
2 changed files with 23 additions and 0 deletions

View 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);
}

View file

@ -29,7 +29,11 @@
#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);