diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2015-02-03 13:05:20 +0100 |
---|---|---|
committer | Daniel Molkentin <daniel@molkentin.de> | 2015-02-07 16:19:59 +0000 |
commit | f4b8697c40bd476ef6bf83418e144adce7c7d4a3 (patch) | |
tree | d5f7c03b627a459c5a6461ded2abc6d102c115ee /src/widgets | |
parent | 45b60c01efc735ce9910d7724ee300855194ff33 (diff) |
Handle gracefully the removal and re-attachment of all QScreens
Don't crash; restore windows when all screens are removed and re-added.
xcb: on configure notify, check for screen change: it may be that a
window belonging to a screen which was removed has now gotten mapped
to the new screen. On screen change, send a synthetic expose event,
because the real expose events already happened.
Task-number: QTBUG-38326
Task-number: QTBUG-32973
Task-number: QTBUG-42985
Change-Id: If334f55c248468ad3c95e7066bb14eca377d2050
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qwidgetwindow.cpp | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index d6a106cef5..ca82dadabb 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -5536,7 +5536,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP } // Native widgets need to be marked dirty on screen so painting will be done in correct context - if (backingStore && !onScreen && !asRoot && (q->internalWinId() || !q->nativeParentWidget()->isWindow())) + if (backingStore && !onScreen && !asRoot && (q->internalWinId() || (q->nativeParentWidget() && !q->nativeParentWidget()->isWindow()))) backingStore->markDirtyOnScreen(toBePainted, q, offset); //restore diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index ed5d56c689..5724df6c55 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -635,7 +635,8 @@ void QWidgetWindow::handleScreenChange() sendScreenChangeRecursively(m_widget); // Invalidate the backing store buffer and repaint immediately. - repaintWindow(); + if (screen()) + repaintWindow(); } void QWidgetWindow::repaintWindow() |