summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-05-10 19:13:21 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-05-10 19:17:32 (GMT)
commit121e325e7bb2f14f4c9e4e25078ac16b47dcd372 (patch)
treee018390d89aaab7f9c50f8af0c8ab7ed09c6374d /src/gui/widgets
parente5622ab31b8cd20074fe29c1d597c1d7f4c6e6e8 (diff)
downloadQt-121e325e7bb2f14f4c9e4e25078ac16b47dcd372.zip
Qt-121e325e7bb2f14f4c9e4e25078ac16b47dcd372.tar.gz
Qt-121e325e7bb2f14f4c9e4e25078ac16b47dcd372.tar.bz2
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.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qdockwidget.cpp5
1 files changed, 4 insertions, 1 deletions
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
}
}