path: root/tests/auto/widgets/kernel/qwidget/BLACKLIST
diff options
authorGatis Paeglis <>2018-06-25 10:50:12 +0200
committerGatis Paeglis <>2018-06-25 13:41:06 +0000
commit2f2bfc4e59cecfdd210663fbf81c000ecddfb822 (patch)
tree785c774b11b11eda038ae73a04f15abc72f1b4da /tests/auto/widgets/kernel/qwidget/BLACKLIST
parent0877ced9806c99d02454a7336ecf0299bc4113ae (diff)
widgets: fix QWidget::save/restoreGeometry()
QWidget::restoreGeometry() is calling QWidget::move() with restoredFrameGeometry, which internally calls setGeometry() and sets positionPolicy = QWindowPrivate::WindowFrameExclusive, which is invalid: restoredFrameGeometry is WindowFrameInclusive geometry. QPA plugins rely on correctly set policies when interpreting x,y. QWidget::move() was not designed for this AFAICT, so making it to accept frame geometry is no-op. It is widely used legacy code, changing it could cause regressions. Save/restore API was introduced in Qt 4.2, at that time we did not have APIs like QWindow::setFramePosition(), so its unclear why geometry() was not stored instead. The documentation also is somewhat unclear: "[..] save the geometry when the window closes [..]" Frame or client geometry? It does not specify. And from the code we see that frame geometry was passed as client geometry, not making the original intention clearer. Besides that, restoreGeometry() is full of other undocumented assumptions where to place windows and when to fail (fortunately its easy to write your own save/restore logic). Added a Qt 6 note in the source code. What this patch changes: Now we store geometry() in saveGeometry() and use that value in restoreGeometry() by setGeometry(). This does not cause any behavior difference in window positioning (tst_QWidget::saveRestoreGeometry still works). Geometry restored from data saved with earlier versions of saveGeometry() might be positioned at: x + leftMargin, y + topMargin. This patch makes tst_QWidget::saveRestoreGeometry to always fail instead of being flaky. Blacklisting for XCB instead of selected distros. Also enabled excluded code paths for XCB on tst_QDockWidget::restoreDockWidget(). It does not seem to be flaky, maybe it was in 2015, but lot of things have changed since then. Task-number: QTBUG-66708 Change-Id: Ic86a6fd091e2c71b7550b2f476386da704253cd4 Reviewed-by: Tor Arne Vestbø <>
Diffstat (limited to 'tests/auto/widgets/kernel/qwidget/BLACKLIST')
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST
index c86dcfb782..86c196f773 100644
--- a/tests/auto/widgets/kernel/qwidget/BLACKLIST
+++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST
@@ -2,10 +2,9 @@
# QTBUG-66708