summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2010-04-06 17:24:20 -0400
committerKristian Høgsberg <krh@bitplanet.net>2010-04-06 17:25:29 -0400
commit8d55cc69e5f05a5230110b3c34f1acd812cfc235 (patch)
tree43fa5c320136f9efc92e29af3c2704908321a71a
parent5ad729109a66fe70dfbeddcf48769caa4aafae66 (diff)
glx: Destroy GLX drawables by the GLX XIDglx-destroy-mess
The DestroyWindow hook only works when the GLX drawable XID is the same as the X window XID. This is only the case for drawables created through the pre-GLX-1.3 compatibility mechanism. GLX Drawables created using glXCreateWindow get a different XID and we need to look up the GLX private and pass the GLX XID to FreeResource instead. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
-rw-r--r--glx/glxscreens.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index 58d8ee0b4..b3dad33ed 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -353,8 +353,11 @@ glxDestroyWindow(WindowPtr pWin)
ScreenPtr pScreen = pWin->drawable.pScreen;
__GLXscreen *pGlxScreen = glxGetScreen(pScreen);
Bool retval = TRUE;
+ __GLXdrawable *drawable;
- FreeResource(pWin->drawable.id, FALSE);
+ drawable = glxGetDrawableFromWindow(pWin);
+ if (drawable != NULL)
+ FreeResource(drawable->drawId, FALSE);
/* call lower wrapped functions */
if (pGlxScreen->DestroyWindow) {