diff options
author | Nick D'Ademo <nickdademo@gmail.com> | 2018-11-05 15:13:19 +0800 |
---|---|---|
committer | Nick D'Ademo <nickdademo@gmail.com> | 2018-11-27 00:49:01 +0000 |
commit | 4744f31e59711a407ffaf2db725711aec41bc134 (patch) | |
tree | d7ae9363f3d4b3e8de7d3c8f9a9c7ea5d8e51c77 | |
parent | ec5e692c1c4d8576d19723bb1193703275efdc90 (diff) |
QMdiArea: Do not reset tiled flag on spontaneous system window events
Do not reset the isSubWindowsTiled flag if the hide/show event is an
external (spontaneous) system window event, i.e. we should instead
reset this flag when the subwindow itself is directly hidden or
shown. This change ensures that tiling will be performed during the
resizeEvent after an application window minimize (hide) and then
restore (show).
Change-Id: Ib37f52f1162b493be3413fc59951be2f30701439
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
-rw-r--r-- | src/widgets/widgets/qmdiarea.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp index f32cd26478..c1817060dd 100644 --- a/src/widgets/widgets/qmdiarea.cpp +++ b/src/widgets/widgets/qmdiarea.cpp @@ -2640,7 +2640,11 @@ bool QMdiArea::eventFilter(QObject *object, QEvent *event) #endif // QT_CONFIG(tabbar) Q_FALLTHROUGH(); case QEvent::Hide: - d->isSubWindowsTiled = false; + // Do not reset the isSubWindowsTiled flag if the event is a spontaneous system window event. + // This ensures that tiling will be performed during the resizeEvent after an application + // window minimize (hide) and then restore (show). + if (!event->spontaneous()) + d->isSubWindowsTiled = false; break; #if QT_CONFIG(rubberband) case QEvent::Close: |