diff --git a/glx/glxdri2.c b/glx/glxdri2.c index 9752003..87918d9 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -451,7 +451,7 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen, private->base.waitGL = __glXDRIdrawableWaitGL; private->base.waitX = __glXDRIdrawableWaitX; - if (DRI2CreateDrawable(pDraw)) { + if (DRI2CreateDrawable(pDraw, drawId)) { xfree(private); return NULL; } diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index 642ea19..05da225 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -125,13 +125,16 @@ DRI2GetDrawable(DrawablePtr pDraw) } int -DRI2CreateDrawable(DrawablePtr pDraw) +DRI2CreateDrawable(DrawablePtr pDraw, XID id) { DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen); DRI2DrawablePtr pPriv; CARD64 ust; int rc; + if (!pDraw->id) + pDraw->id = id; + rc = dixLookupResourceByType((pointer *) &pPriv, pDraw->id, dri2DrawableRes, NULL, DixReadAccess); if (rc == Success || rc != BadValue) diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h index a695c6d..42dd66e 100644 --- a/hw/xfree86/dri2/dri2.h +++ b/hw/xfree86/dri2/dri2.h @@ -199,7 +199,7 @@ extern _X_EXPORT Bool DRI2Connect(ScreenPtr pScreen, extern _X_EXPORT Bool DRI2Authenticate(ScreenPtr pScreen, drm_magic_t magic); -extern _X_EXPORT int DRI2CreateDrawable(DrawablePtr pDraw); +extern _X_EXPORT int DRI2CreateDrawable(DrawablePtr pDraw, XID id); extern _X_EXPORT void DRI2DestroyDrawable(DrawablePtr pDraw); diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c index 78f897b..6015126 100644 --- a/hw/xfree86/dri2/dri2ext.c +++ b/hw/xfree86/dri2/dri2ext.c @@ -167,7 +167,7 @@ ProcDRI2CreateDrawable(ClientPtr client) &pDrawable, &status)) return status; - status = DRI2CreateDrawable(pDrawable); + status = DRI2CreateDrawable(pDrawable, stuff->drawable); if (status != Success) return status;