From 121e325e7bb2f14f4c9e4e25078ac16b47dcd372 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 10 May 2010 21:13:21 +0200 Subject: Really fix tst_QDockWidget::taskQTBUG_9758_undockedGeometry on Linux If there is no window manager the current coordinate are taken in account even if WA_Moved is false. When a dockwidget is hidden, it is sent far in the negative coordinate. The test was failing because the WM is assync and may take some time to update the geometry. --- src/gui/widgets/qdockwidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/qdockwidget.cpp b/src/gui/widgets/qdockwidget.cpp index ae00710..11f0a94 100644 --- a/src/gui/widgets/qdockwidget.cpp +++ b/src/gui/widgets/qdockwidget.cpp @@ -1269,8 +1269,11 @@ void QDockWidget::setFloating(bool floating) QRect r = d->undockedGeometry; d->setWindowState(floating, false, floating ? r : QRect()); + if (floating && r.isNull()) { - setAttribute(Qt::WA_Moved, false); //we want it at the default position + if (x() < 0 || y() < 0) //may happen if we have been hidden + move(QPoint()); + setAttribute(Qt::WA_Moved, false); //we want it at the default position } } -- cgit v0.12