From 668d9fc40ea474021e2c215c46e9c5fc3c08f614 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 30 Sep 2024 17:53:32 +0200 Subject: [PATCH] dbe: use dixDestroyPixmap() instead of direct driver call Direct calls to ScreenRec->DestroyPixmap() blocks cleaning up the wrapping jungle, so use the proper dix function instead. See: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1754 Signed-off-by: Enrico Weigelt, metux IT consult Part-of: --- dbe/midbe.c | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/dbe/midbe.c b/dbe/midbe.c index 379b7a024..3033062f8 100644 --- a/dbe/midbe.c +++ b/dbe/midbe.c @@ -162,7 +162,7 @@ miDbeAllocBackBufferName(WindowPtr pWin, XID bufId, int swapAction) (*pScreen->CreatePixmap) (pScreen, pDbeWindowPriv->width, pDbeWindowPriv->height, pWin->drawable.depth, 0))) { - (*pScreen->DestroyPixmap) (pDbeWindowPriv->pFrontBuffer); + dixDestroyPixmap(pDbeWindowPriv->pFrontBuffer, 0); return BadAlloc; } @@ -426,14 +426,11 @@ miDbeWinPrivDelete(DbeWindowPrivPtr pDbeWindowPriv, XID bufId) */ /* Destroy the front and back pixmaps. */ - if (pDbeWindowPriv->pFrontBuffer) { - (*pDbeWindowPriv->pWindow->drawable.pScreen-> - DestroyPixmap) (pDbeWindowPriv->pFrontBuffer); - } - if (pDbeWindowPriv->pBackBuffer) { - (*pDbeWindowPriv->pWindow->drawable.pScreen-> - DestroyPixmap) (pDbeWindowPriv->pBackBuffer); - } + if (pDbeWindowPriv->pFrontBuffer) + dixDestroyPixmap(pDbeWindowPriv->pFrontBuffer, 0); + + if (pDbeWindowPriv->pBackBuffer) + dixDestroyPixmap(pDbeWindowPriv->pBackBuffer, 0); } /* miDbeWinPrivDelete() */ /****************************************************************************** @@ -585,13 +582,8 @@ miDbePositionWindow(WindowPtr pWin, int x, int y) if (!pFrontBuffer || !pBackBuffer) { /* We failed at creating 1 or 2 of the pixmaps. */ - if (pFrontBuffer) { - (*pScreen->DestroyPixmap) (pFrontBuffer); - } - - if (pBackBuffer) { - (*pScreen->DestroyPixmap) (pBackBuffer); - } + dixDestroyPixmap(pFrontBuffer, 0); + dixDestroyPixmap(pBackBuffer, 0); /* Destroy all buffers for this window. */ while (pDbeWindowPriv) { @@ -642,8 +634,8 @@ miDbePositionWindow(WindowPtr pWin, int x, int y) * pixmaps. */ - (*pScreen->DestroyPixmap) (pDbeWindowPriv->pFrontBuffer); - (*pScreen->DestroyPixmap) (pDbeWindowPriv->pBackBuffer); + dixDestroyPixmap(pDbeWindowPriv->pFrontBuffer, 0); + dixDestroyPixmap(pDbeWindowPriv->pBackBuffer, 0); pDbeWindowPriv->pFrontBuffer = pFrontBuffer; pDbeWindowPriv->pBackBuffer = pBackBuffer;