Do not call markDirty() for hidden widgets.
authorSamuel Rødal <samuel.rodal@nokia.com>
Fri, 3 Aug 2012 12:55:39 +0000 (14:55 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 6 Aug 2012 01:21:38 +0000 (03:21 +0200)
Fixed crash when resizing a scroll area with a native viewport
(typically a QGLWidget) causes the scroll bars to get hidden, while
there are still expose events in the queue for the scroll bar widget.

Task-number: QTBUG-26746
Change-Id: Ia77c8eb32a6730670333120af3f9a772c64807f1
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
src/widgets/kernel/qwidgetwindow.cpp

index 10de176..6631342 100644 (file)
@@ -492,7 +492,7 @@ void QWidgetWindow::handleExposeEvent(QExposeEvent *event)
         m_widget->setAttribute(Qt::WA_Mapped);
         if (!event->region().isNull()) {
             // Exposed native widgets need to be marked dirty to get them repainted correctly.
-            if (m_widget->internalWinId() && !m_widget->isWindow() && m_widget->updatesEnabled()) {
+            if (m_widget->internalWinId() && !m_widget->isWindow() && m_widget->isVisible() && m_widget->updatesEnabled()) {
                 if (QWidgetBackingStore *bs = m_widget->d_func()->maybeBackingStore())
                     bs->markDirty(event->region(), m_widget);
             }