From 39897b3b712e902a8eabdf7b947b5d82ca5e8754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 30 Oct 2025 16:45:23 +0100 Subject: [PATCH] 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. Part-of: --- composite/compalloc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/composite/compalloc.c b/composite/compalloc.c index 63b3059e9..51ceeab7e 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -528,6 +528,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) { @@ -562,7 +571,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;