From d429146431693eb4e931bf91ccc255044eb49022 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Mon, 24 Sep 2018 13:51:01 +0200 Subject: [PATCH] Keep tiled subwindow order on resize QMdiArea::tileSubWindows() will move the active window to the first position, in order to be consistent with other MDI applications on Windows (according to the original commit message). However, the same function is also used for re-tiling on resize, so we must make sure to not reorder in that case. Fixes: QTBUG-51761 Change-Id: Ibf93a0bf7e663f983b9160364f812c84b5539171 Reviewed-by: Friedemann Kleint Reviewed-by: Richard Moe Gustavsen --- src/widgets/widgets/qmdiarea.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp index 8639f57ea1..f32cd26478 100644 --- a/src/widgets/widgets/qmdiarea.cpp +++ b/src/widgets/widgets/qmdiarea.cpp @@ -954,7 +954,7 @@ void QMdiAreaPrivate::rearrange(Rearranger *rearranger) } } - if (active && rearranger->type() == Rearranger::RegularTiler) { + if (active && rearranger->type() == Rearranger::RegularTiler && !tileCalledFromResizeEvent) { // Move active window in front if necessary. That's the case if we // have any windows with staysOnTopHint set. int indexToActive = widgets.indexOf((QWidget *)active);