diff --git a/src/DockWidgetBase.cpp b/src/DockWidgetBase.cpp index b13a0526..6cbe4cd7 100644 --- a/src/DockWidgetBase.cpp +++ b/src/DockWidgetBase.cpp @@ -146,6 +146,8 @@ DockWidgetBase::DockWidgetBase(const QString &name, Options options) if (name.isEmpty()) qWarning() << Q_FUNC_INFO << "Name can't be null"; + + setAttribute(Qt::WA_PendingMoveEvent, false); } DockWidgetBase::~DockWidgetBase() @@ -528,7 +530,7 @@ FloatingWindow *DockWidgetBase::morphIntoFloatingWindow() if (geo.isNull()) { geo = geometry(); - if (!testAttribute(Qt::WA_Moved)) { // If user already moved it, we don't interfere + if (!testAttribute(Qt::WA_PendingMoveEvent)) { // If user already moved it, we don't interfere const QPoint center = d->defaultCenterPosForFloating(); if (!center.isNull()) geo.moveCenter(center); diff --git a/tests/tst_common.cpp b/tests/tst_common.cpp index 3e742bb8..cf82d78f 100644 --- a/tests/tst_common.cpp +++ b/tests/tst_common.cpp @@ -418,6 +418,7 @@ void TestCommon::tst_honourUserGeometry() EnsureTopLevelsDeleted e; auto m1 = createMainWindow(QSize(1000, 1000), MainWindowOption_None); auto dw1 = new DockWidgetType(QStringLiteral("1")); + QVERIFY(!dw1->testAttribute(Qt::WA_PendingMoveEvent)); const QPoint pt(10, 10); dw1->move(pt);