summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidgetbackingstore.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-09-28 18:51:45 +0200
committerLaszlo Agocs <laszlo.agocs@digia.com>2014-09-30 09:38:38 +0200
commit90ce9701d088e7f1e93764f36fa0e54347b62438 (patch)
treee9b161e838e76c39b698f23e0a017f3140865547 /src/widgets/kernel/qwidgetbackingstore.cpp
parent5d36c74cb687ceb7c8bef1c36d3eb6c62adb61a9 (diff)
Fix losing dirty state when calling update() from paintGL()
When the paint for the QOpenGLWidget was in invoked on the fast path, where only that widget was dirty, the resetWidget call after sending the paint event removed the widget from the dirty list, making it impossible to schedule an update during the event handling. The correct way is to clean the list and then send the paint events. Change-Id: Icdad5686ded7944fd1c8af56496f725e163a60e6 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/widgets/kernel/qwidgetbackingstore.cpp')
-rw-r--r--src/widgets/kernel/qwidgetbackingstore.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp
index 242872d6b2..00052c868f 100644
--- a/src/widgets/kernel/qwidgetbackingstore.cpp
+++ b/src/widgets/kernel/qwidgetbackingstore.cpp
@@ -1135,12 +1135,17 @@ void QWidgetBackingStore::doSync()
// prevent triggering unnecessary backingstore painting when only the
// OpenGL content changes. Check if we have such widgets in the special
// dirty list.
+ QVarLengthArray<QWidget *, 16> paintPending;
for (int i = 0; i < dirtyRenderToTextureWidgets.count(); ++i) {
QWidget *w = dirtyRenderToTextureWidgets.at(i);
- w->d_func()->sendPaintEvent(w->rect());
+ paintPending << w;
resetWidget(w);
}
dirtyRenderToTextureWidgets.clear();
+ for (int i = 0; i < paintPending.count(); ++i) {
+ QWidget *w = paintPending[i];
+ w->d_func()->sendPaintEvent(w->rect());
+ }
// We might have newly exposed areas on the screen if this function was
// called from sync(QWidget *, QRegion)), so we have to make sure those