From bd3d2724f51a44b7fc814a5bc43d8ddafa8e3cba Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Tue, 20 Jul 2010 12:21:17 +0200 Subject: glx/dri2: Fix dri2CopySubBuffer() again. Only refresh the fake front buffer if there is one, and only destroy the region once. Fixes X11 protocol errors reported by 'mcgreg' on IRC. --- src/glx/dri2_glx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/glx') diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 4fbe9496b1..be8671d906 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -352,13 +352,14 @@ dri2CopySubBuffer(__GLXDRIdrawable *pdraw, int x, int y, int width, int height) region = XFixesCreateRegion(psc->base.dpy, &xrect, 1); DRI2CopyRegion(psc->base.dpy, pdraw->xDrawable, region, DRI2BufferFrontLeft, DRI2BufferBackLeft); - XFixesDestroyRegion(psc->base.dpy, region); /* Refresh the fake front (if present) after we just damaged the real * front. */ - DRI2CopyRegion(psc->base.dpy, pdraw->xDrawable, region, - DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft); + if (priv->have_fake_front) + DRI2CopyRegion(psc->base.dpy, pdraw->xDrawable, region, + DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft); + XFixesDestroyRegion(psc->base.dpy, region); } -- cgit v1.2.3