aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/composite/compwindow.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/composite/compwindow.c')
-rw-r--r--xorg-server/composite/compwindow.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/xorg-server/composite/compwindow.c b/xorg-server/composite/compwindow.c
index ef1f7f154..967e992c9 100644
--- a/xorg-server/composite/compwindow.c
+++ b/xorg-server/composite/compwindow.c
@@ -164,8 +164,18 @@ compCheckRedirect (WindowPtr pWin)
{
if (should)
return compAllocPixmap (pWin);
+ else {
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin);
+ compSetParentPixmap (pWin);
+ compRestoreWindow (pWin, pPixmap);
+ (*pScreen->DestroyPixmap) (pPixmap);
+ }
+ } else if (should) {
+ if (cw->update == CompositeRedirectAutomatic)
+ pWin->redirectDraw = RedirectDrawAutomatic;
else
- compFreePixmap (pWin);
+ pWin->redirectDraw = RedirectDrawManual;
}
return TRUE;
}
@@ -583,8 +593,11 @@ compDestroyWindow (WindowPtr pWin)
while ((csw = GetCompSubwindows (pWin)))
FreeResource (csw->clients->id, RT_NONE);
- if (pWin->redirectDraw != RedirectDrawNone)
- compFreePixmap (pWin);
+ if (pWin->redirectDraw != RedirectDrawNone) {
+ PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin);
+ compSetParentPixmap (pWin);
+ (*pScreen->DestroyPixmap) (pPixmap);
+ }
ret = (*pScreen->DestroyWindow) (pWin);
cs->DestroyWindow = pScreen->DestroyWindow;
pScreen->DestroyWindow = compDestroyWindow;