--- ./src/glx/x11/glx_pbuffer.c.fix-pbuffer-dispatch 2006-02-06 19:41:27.000000000 -0500 +++ ./src/glx/x11/glx_pbuffer.c 2006-06-12 17:49:46.000000000 -0400 @@ -72,12 +72,13 @@ { __GLXdisplayPrivate *priv = __glXInitialize(dpy); CARD32 * output; - + CARD8 opcode; if ( (dpy == NULL) || (drawable == 0) ) { return; } + opcode = __glXSetupForCommand(dpy); LockDisplay(dpy); @@ -87,7 +88,7 @@ GetReqExtra( GLXChangeDrawableAttributes, 8 + (8 * num_attribs), req ); output = (CARD32 *) (req + 1); - req->reqType = __glXSetupForCommand(dpy); + req->reqType = opcode; req->glxCode = X_GLXChangeDrawableAttributes; req->drawable = drawable; req->numAttribs = (CARD32) num_attribs; @@ -98,7 +99,7 @@ GetReqExtra( GLXVendorPrivateWithReply, 4 + (8 * num_attribs), vpreq ); output = (CARD32 *) (vpreq + 1); - vpreq->reqType = __glXSetupForCommand(dpy); + vpreq->reqType = opcode; vpreq->glxCode = X_GLXVendorPrivateWithReply; vpreq->vendorCode = X_GLXvop_ChangeDrawableAttributesSGIX; @@ -132,11 +133,13 @@ DestroyPbuffer( Display * dpy, GLXDrawable drawable ) { __GLXdisplayPrivate *priv = __glXInitialize(dpy); + CARD8 opcode; if ( (dpy == NULL) || (drawable == 0) ) { return; } + opcode = __glXSetupForCommand(dpy); LockDisplay(dpy); @@ -144,7 +147,7 @@ xGLXDestroyPbufferReq * req; GetReqExtra( GLXDestroyPbuffer, 4, req ); - req->reqType = __glXSetupForCommand(dpy); + req->reqType = opcode; req->glxCode = X_GLXDestroyPbuffer; req->pbuffer = (GLXPbuffer) drawable; } @@ -157,7 +160,7 @@ data[0] = (CARD32) drawable; - vpreq->reqType = __glXSetupForCommand(dpy); + vpreq->reqType = opcode; vpreq->glxCode = X_GLXVendorPrivateWithReply; vpreq->vendorCode = X_GLXvop_DestroyGLXPbufferSGIX; } @@ -194,6 +197,7 @@ __GLXdisplayPrivate *priv = __glXInitialize(dpy); xGLXGetDrawableAttributesReply reply; CARD32 * data; + CARD8 opcode; unsigned int length; unsigned int i; unsigned int num_attributes; @@ -206,6 +210,7 @@ return 0; } + opcode = __glXSetupForCommand(dpy); LockDisplay(dpy); @@ -213,7 +218,7 @@ xGLXGetDrawableAttributesReq *req; GetReqExtra( GLXGetDrawableAttributes, 4, req ); - req->reqType = __glXSetupForCommand(dpy); + req->reqType = opcode; req->glxCode = X_GLXGetDrawableAttributes; req->drawable = drawable; } @@ -224,7 +229,7 @@ data = (CARD32 *) (vpreq + 1); data[0] = (CARD32) drawable; - vpreq->reqType = __glXSetupForCommand(dpy); + vpreq->reqType = opcode; vpreq->glxCode = X_GLXVendorPrivateWithReply; vpreq->vendorCode = X_GLXvop_GetDrawableAttributesSGIX; } @@ -284,6 +289,7 @@ xGLXCreateWindowReq * req; CARD32 * data; unsigned int i; + CARD8 opcode; i = 0; if (attrib_list) { @@ -291,11 +297,13 @@ i++; } + opcode = __glXSetupForCommand(dpy); + LockDisplay(dpy); GetReqExtra( GLXCreateWindow, 8 * i, req ); data = (CARD32 *) (req + 1); - req->reqType = __glXSetupForCommand(dpy); + req->reqType = opcode; req->glxCode = glxCode; req->screen = (CARD32) fbconfig->screen; req->fbconfig = fbconfig->fbconfigID; @@ -322,16 +330,19 @@ DestroyDrawable( Display * dpy, GLXDrawable drawable, CARD32 glxCode ) { xGLXDestroyPbufferReq * req; + CARD8 opcode; if ( (dpy == NULL) || (drawable == 0) ) { return; } + opcode = __glXSetupForCommand(dpy); + LockDisplay(dpy); GetReqExtra( GLXDestroyPbuffer, 4, req ); - req->reqType = __glXSetupForCommand(dpy); + req->reqType = opcode; req->glxCode = glxCode; req->pbuffer = (GLXPbuffer) drawable; @@ -363,6 +374,7 @@ __GLXdisplayPrivate *priv = __glXInitialize(dpy); GLXDrawable id = 0; CARD32 * data; + CARD8 opcode; unsigned int i; i = 0; @@ -371,6 +383,7 @@ i++; } + opcode = __glXSetupForCommand(dpy); LockDisplay(dpy); id = XAllocID(dpy); @@ -381,7 +394,7 @@ GetReqExtra( GLXCreatePbuffer, (8 * (i + extra)), req ); data = (CARD32 *) (req + 1); - req->reqType = __glXSetupForCommand(dpy); + req->reqType = opcode; req->glxCode = X_GLXCreatePbuffer; req->screen = (CARD32) fbconfig->screen; req->fbconfig = fbconfig->fbconfigID; @@ -402,7 +415,7 @@ GetReqExtra( GLXVendorPrivate, 20 + (8 * i), vpreq ); data = (CARD32 *) (vpreq + 1); - vpreq->reqType = __glXSetupForCommand(dpy); + vpreq->reqType = opcode; vpreq->glxCode = X_GLXVendorPrivate; vpreq->vendorCode = X_GLXvop_CreateGLXPbufferSGIX;