From 3344a4eda704edc7dc30037f095de277a60a70bb Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Thu, 15 Feb 2007 16:27:50 +0100 Subject: DRI: Make sure number of DRI windows is accurate in driver ClipNotify hook. Always call DRI{De,In}creaseNumberVisible (which in turn calls DRIDriverClipNotify) after updating pDRIPriv->nrWindows. --- hw/xfree86/dri/dri.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'hw/xfree86/dri/dri.c') diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index bdef75ad9..c183e2a1f 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -1134,11 +1134,11 @@ DRICreateDrawable(ScreenPtr pScreen, Drawable id, pWin->devPrivates[DRIWindowPrivIndex].ptr = (pointer)pDRIDrawablePriv; + pDRIPriv->nrWindows++; + if (pDRIDrawablePriv->nrects) DRIIncreaseNumberVisible(pScreen); - pDRIPriv->nrWindows++; - /* track this in case this window is destroyed */ AddResource(id, DRIDrawablePrivResType, (pointer)pWin); } @@ -1210,13 +1210,13 @@ DRIDrawablePrivDelete(pointer pResource, XID id) return FALSE; } - if (pDRIDrawablePriv->nrects) - DRIDecreaseNumberVisible(pDrawable->pScreen); - xfree(pDRIDrawablePriv); pWin->devPrivates[DRIWindowPrivIndex].ptr = NULL; pDRIPriv->nrWindows--; + + if (REGION_NUM_RECTS(&pWin->clipList)) + DRIDecreaseNumberVisible(pDrawable->pScreen); } else { /* pixmap (or for GLX 1.3, a PBuffer) */ /* NOT_DONE */ -- cgit v1.2.3