From 75672d2e94e351cb8a65069e20cbcc941e046a1a Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 1 Oct 2004 04:34:01 +0000 Subject: [PATCH] Fix mesa solo with doublebuffered apps, the drawable index/stamp weren't being updated properly.. --- src/glx/mini/miniglx.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/glx/mini/miniglx.c b/src/glx/mini/miniglx.c index 5ea8af2..fc0ca08 100644 --- a/src/glx/mini/miniglx.c +++ b/src/glx/mini/miniglx.c @@ -1711,7 +1711,7 @@ glXChooseVisual( Display *dpy, int screen, int *attribList ) GLint redBits = 0, greenBits = 0, blueBits = 0, alphaBits = 0; GLint indexBits = 0, depthBits = 0, stencilBits = 0; GLint numSamples = 0; - int i; + int i=0; /* * XXX in the future, might be interpreted as a VT @@ -1805,6 +1805,7 @@ glXChooseVisual( Display *dpy, int screen, int *attribList ) (void) alphaBits; (void) stereoFlag; for ( mode = dpy->driver_modes ; mode != NULL ; mode = mode->next ) { + i++; if (mode->rgbMode == rgbFlag && mode->doubleBufferMode == dbFlag && mode->redBits >= redBits && @@ -2149,7 +2150,8 @@ __glXGetDrawableInfo(__DRInativeDisplay *dpy, int scrn, { GLXDrawable drawable = (GLXDrawable) draw; drm_clip_rect_t * cliprect; - + Display* display = (Display*)dpy; + __DRIcontextPrivate *pcp = (__DRIcontextPrivate *)CurrentContext->driContext.private; if (drawable == 0) { return GL_FALSE; } @@ -2159,15 +2161,20 @@ __glXGetDrawableInfo(__DRInativeDisplay *dpy, int scrn, cliprect->y1 = drawable->y; cliprect->x2 = drawable->x + drawable->w; cliprect->y2 = drawable->y + drawable->h; + + /* the drawable index is by client id */ + *index = display->clientID; + *stamp = pcp->driScreenPriv->pSAREA->drawableTable[display->clientID].stamp; *x = drawable->x; *y = drawable->y; *width = drawable->w; *height = drawable->h; *numClipRects = 1; *pClipRects = cliprect; - *backX = 0; - *backY = 0; + + *backX = drawable->x; + *backY = drawable->y; *numBackClipRects = 0; *pBackClipRects = 0; -- 2.7.4