From 378ff29b29d597fb9d4316be1da35402fefd33de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20M=C3=A4=C3=A4tt=C3=A4?= Date: Tue, 12 Oct 2021 12:28:32 +0300 Subject: [PATCH] Don't render widget to backing store if its parent has graphics effect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If widget parent has graphics effect, it can't render directly to the backing store, because the backing store needs to be updated from the parents effect drawing instead of the widget drawing. Pick-to: 6.2 5.15 Fixes: QTBUG-96240 Change-Id: Ib9b55547f9e5538f32837ec9df45d29fa68d7c1b Reviewed-by: Tomi Korpipää Reviewed-by: Tor Arne Vestbø --- src/widgets/kernel/qwidgetrepaintmanager.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/widgets/kernel/qwidgetrepaintmanager.cpp b/src/widgets/kernel/qwidgetrepaintmanager.cpp index 1997f76b1d..977a746c5a 100644 --- a/src/widgets/kernel/qwidgetrepaintmanager.cpp +++ b/src/widgets/kernel/qwidgetrepaintmanager.cpp @@ -801,6 +801,18 @@ bool QWidgetRepaintManager::syncAllowed() return true; } +static bool isDrawnInEffect(const QWidget *w) +{ +#if QT_CONFIG(graphicseffect) + do { + if (w->graphicsEffect()) + return true; + w = w->parentWidget(); + } while (w); +#endif + return false; +} + void QWidgetRepaintManager::paintAndFlush() { qCInfo(lcWidgetPainting) << "Painting and flushing dirty" @@ -888,7 +900,8 @@ void QWidgetRepaintManager::paintAndFlush() } #endif - if (!hasDirtySiblingsAbove && wd->isOpaque && !dirty.intersects(widgetDirty.boundingRect())) { + if (!isDrawnInEffect(w) && !hasDirtySiblingsAbove && wd->isOpaque + && !dirty.intersects(widgetDirty.boundingRect())) { opaqueNonOverlappedWidgets.append(w); } else { resetWidget(w);