summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidgetbackingstore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel/qwidgetbackingstore.cpp')
-rw-r--r--src/widgets/kernel/qwidgetbackingstore.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp
index 049ed248de..5d13fb926b 100644
--- a/src/widgets/kernel/qwidgetbackingstore.cpp
+++ b/src/widgets/kernel/qwidgetbackingstore.cpp
@@ -1211,10 +1211,20 @@ void QWidgetBackingStore::doSync()
// We know for sure that the widget isn't overlapped if 'isMoved' is true.
if (!wd->isMoved)
wd->subtractOpaqueSiblings(wd->dirty, &hasDirtySiblingsAbove);
+
+ // Make a copy of the widget's dirty region, to restore it in case there is an opaque
+ // render-to-texture child that completely covers the widget, because otherwise the
+ // render-to-texture child won't be visible, due to its parent widget not being redrawn
+ // with a proper blending mask.
+ const QRegion dirtyBeforeSubtractedOpaqueChildren = wd->dirty;
+
// Scrolled and moved widgets must draw all children.
if (!wd->isScrolled && !wd->isMoved)
wd->subtractOpaqueChildren(wd->dirty, w->rect());
+ if (wd->dirty.isEmpty() && wd->textureChildSeen)
+ wd->dirty = dirtyBeforeSubtractedOpaqueChildren;
+
if (wd->dirty.isEmpty()) {
resetWidget(w);
continue;