composite: Skip copying parent pixmap contents when possible

If the parent window has a different depth (which means pWin can't have
valid contents yet) and pWin has effective background other than None.
This commit is contained in:
Michel Dänzer
2025-12-12 02:55:02 +02:00
committed by Enrico Weigelt
parent d6fc3aa717
commit 96c23315e4

View File

@@ -527,6 +527,15 @@ compUnredirectOneSubwindow(WindowPtr pParent, WindowPtr pWin)
return Success;
}
static unsigned
compGetBackgroundState(WindowPtr pWin)
{
while (pWin->backgroundState == ParentRelative)
pWin = pWin->parent;
return pWin->backgroundState;
}
static PixmapPtr
compNewPixmap(WindowPtr pWin, int x, int y, int w, int h)
{
@@ -568,7 +577,7 @@ compNewPixmap(WindowPtr pWin, int x, int y, int w, int h)
FreeScratchGC(pGC);
}
}
else {
else if (compGetBackgroundState(pWin) == None) {
PictFormatPtr pSrcFormat = PictureWindowFormat(pParent);
PictFormatPtr pDstFormat = PictureWindowFormat(pWin);
XID inferiors = IncludeInferiors;