From 5de49ab4ed0aff4e89f234c0168f89c10263297c Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Tue, 10 Apr 2018 17:21:40 +0100 Subject: Fix grouped dock widget from shifting down when created Animated .git attached to the bug report for easy understanding. Looks like we shouldn't set window flags after a setGeometry() and before having the window resources. If we do that, then the requested geometry won't be honoured. No idea if it can be fixable in the QPA and won't risk doing it there. Fixes the problem on macOS and Windows. On Linux it was OK, and still is. Task-number: QTBUG-67611 Change-Id: I8244b4956a5ac9afcf257bea762c2c3084b563f8 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/widgets/widgets/qmainwindowlayout.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp index 2e773a5790..34ad88913d 100644 --- a/src/widgets/widgets/qmainwindowlayout.cpp +++ b/src/widgets/widgets/qmainwindowlayout.cpp @@ -467,6 +467,8 @@ void QDockWidgetGroupWindow::adjustFlags() } if (oldFlags != flags) { + if (!windowHandle()) + create(); // The desired geometry is forgotten if we call setWindowFlags before having a window setWindowFlags(flags); const bool gainedNativeDecos = (oldFlags & Qt::FramelessWindowHint) && !(flags & Qt::FramelessWindowHint); const bool lostNativeDecos = !(oldFlags & Qt::FramelessWindowHint) && (flags & Qt::FramelessWindowHint); -- cgit v1.2.3