summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
authorChris Colbert <sccolbert@gmail.com>2013-12-01 16:47:30 -0500
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-04 15:59:05 +0100
commit6060dab13a3b3d0c3c5c3d45a1eb3273fb753313 (patch)
tree9433fefb8f13b52fe0cb7658531c7a24d7d0b31c /src/widgets/kernel
parent26cf0f0d5a81907b5ee5c4ffb3aeb13c6d681d89 (diff)
Fix issue where revealed widget children do not receive paint event.
When a child of a widget is spontaneously revealed due to a call to the parent 'resize' method, the child will not receive a paint event if it has the WA_StaticContents and WA_OpaquePaintEvent flags set. This is caused by the backing store being pre-emptively resized by the call to setGeometry_sys, which causes QWidgetBackingStore::sync to skip the block which handles the static contents. There doesn't appear to be any reason to preemptively resize the backing store, since it is always resized as-needed during the the 'sync' method. This change-set removes the code which preemptively resizes the backing store. Task-number: QTBUG-35282 Change-Id: Ie9942854ca5322dfe0f98ed8100810161576be80 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qwidget_qpa.cpp11
-rw-r--r--src/widgets/kernel/qwidgetbackingstore.cpp4
2 files changed, 2 insertions, 13 deletions
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp
index acd80afddb..174b7eb5d5 100644
--- a/src/widgets/kernel/qwidget_qpa.cpp
+++ b/src/widgets/kernel/qwidget_qpa.cpp
@@ -549,12 +549,6 @@ void QWidgetPrivate::show_sys()
window->resize(geomRect.size());
}
- if (QBackingStore *store = q->backingStore()) {
- if (store->size() != geomRect.size()) {
- store->resize(geomRect.size());
- }
- }
-
#ifndef QT_NO_CURSOR
qt_qpa_set_cursor(q, false); // Needed in case cursor was set before show
#endif
@@ -762,11 +756,6 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
QPoint posInNativeParent = q->mapTo(q->nativeParentWidget(),QPoint());
q->windowHandle()->setGeometry(QRect(posInNativeParent,r.size()));
}
- const QWidgetBackingStore *bs = maybeBackingStore();
- if (bs && bs->store) {
- if (isResize)
- bs->store->resize(r.size());
- }
if (needsShow)
show_sys();
diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp
index fe877758ef..221e6825ed 100644
--- a/src/widgets/kernel/qwidgetbackingstore.cpp
+++ b/src/widgets/kernel/qwidgetbackingstore.cpp
@@ -940,7 +940,7 @@ void QWidgetBackingStore::sync(QWidget *exposedWidget, const QRegion &exposedReg
}
// Nothing to repaint.
- if (!isDirty()) {
+ if (!isDirty() && store->size().isValid()) {
qt_flush(exposedWidget, exposedRegion, store, tlw, tlwOffset, widgetTextures);
return;
}
@@ -1035,7 +1035,7 @@ void QWidgetBackingStore::doSync()
const QRect tlwRect(topLevelRect());
const QRect surfaceGeometry(tlwRect.topLeft(), store->size());
if ((fullUpdatePending || inTopLevelResize || surfaceGeometry.size() != tlwRect.size()) && !updatesDisabled) {
- if (hasStaticContents()) {
+ if (hasStaticContents() && !store->size().isEmpty() ) {
// Repaint existing dirty area and newly visible area.
const QRect clipRect(0, 0, surfaceGeometry.width(), surfaceGeometry.height());
const QRegion staticRegion(staticContents(0, clipRect));