summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qwidget.cpp7
-rw-r--r--src/widgets/kernel/qwidgetrepaintmanager.cpp12
2 files changed, 4 insertions, 15 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 45be132e59..cf5a81c204 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -5313,9 +5313,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
}
sourced->context = 0;
- // Native widgets need to be marked dirty on screen so painting will be done in correct context
- // Same check as in the no effects case below.
- if (repaintManager && !asRoot && (q->internalWinId() || !q->nativeParentWidget()->isWindow()))
+ if (repaintManager)
repaintManager->markNeedsFlush(q, rgn, offset);
return;
@@ -5422,8 +5420,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
sendPaintEvent(toBePainted);
}
- // Native widgets need to be marked dirty on screen so painting will be done in correct context
- if (repaintManager && !asRoot && (q->internalWinId() || (q->nativeParentWidget() && !q->nativeParentWidget()->isWindow())))
+ if (repaintManager)
repaintManager->markNeedsFlush(q, toBePainted, offset);
//restore
diff --git a/src/widgets/kernel/qwidgetrepaintmanager.cpp b/src/widgets/kernel/qwidgetrepaintmanager.cpp
index d1ebf7dc25..4eb298e108 100644
--- a/src/widgets/kernel/qwidgetrepaintmanager.cpp
+++ b/src/widgets/kernel/qwidgetrepaintmanager.cpp
@@ -979,12 +979,6 @@ void QWidgetRepaintManager::paintAndFlush()
}
#endif
- // Always flush repainted areas. FIXME: We should mark individual widgets,
- // not the top level widget unconditionally, as this results in always
- // flushing the top level widget, even if the painted region is entirely
- // within a native child.
- markNeedsFlush(tlw, toClean, QPoint());
-
store->beginPaint(toClean);
// Must do this before sending any paint events because
@@ -1041,8 +1035,7 @@ void QWidgetRepaintManager::markNeedsFlush(QWidget *widget, const QRegion &regio
// Top-level (native)
qCInfo(lcWidgetPainting) << "Marking" << region << "of top level"
<< widget << "as needing flush";
- if (!widget->testAttribute(Qt::WA_WState_InPaintEvent))
- topLevelNeedsFlush += region;
+ topLevelNeedsFlush += region;
} else if (!hasPlatformWindow(widget) && !widget->isWindow()) {
QWidget *nativeParent = widget->nativeParentWidget();
qCInfo(lcWidgetPainting) << "Marking" << region << "of"
@@ -1050,8 +1043,7 @@ void QWidgetRepaintManager::markNeedsFlush(QWidget *widget, const QRegion &regio
<< "at offset" << topLevelOffset;
if (nativeParent == tlw) {
// Alien widgets with the top-level as the native parent (common case)
- if (!widget->testAttribute(Qt::WA_WState_InPaintEvent))
- topLevelNeedsFlush += region.translated(topLevelOffset);
+ topLevelNeedsFlush += region.translated(topLevelOffset);
} else {
// Alien widgets with native parent != tlw
const QPoint nativeParentOffset = widget->mapTo(nativeParent, QPoint());