summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Lefebvre <[email protected]>2025-01-21 15:29:36 +0100
committerFrédéric Lefebvre <[email protected]>2025-07-08 16:52:49 +0200
commite0a44e10380d99fc9d8e1775aec52060961c6d6a (patch)
tree67cc3b5130a758188024dcc851cd727c5d64751a
parent642251b56dcd659d996cb3f4497286127cfd1393 (diff)
Verify window's position is correct to fix flakiness when clickingHEADdev
tst_QWindow::testInputEvents() is flaky where the simulated click is sometimes not received by the window. This is caused by an incorrect framePosition, where the position of the window is taken instead. Remove the frame of the window and verify that the window's position has been updated by using the ensurePositionTopLeft() helper function. Include QtTest/private/qtesthelpers_p.h to use the helper function. Fix flaky tst_QWindow::testInputEvents on Opensuse Change-Id: Ie65a70e7a478ff2db60a11f6ef6419dac3489ee6 Reviewed-by: Axel Spoerl <[email protected]>
-rw-r--r--tests/auto/gui/kernel/qwindow/tst_qwindow.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
index 1c8dd14eba4..66bb0fa84d8 100644
--- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
+++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
@@ -11,6 +11,7 @@
#include <QtGui/QPainter>
#include <QTest>
+#include <QtTest/private/qtesthelpers_p.h>
#include <QSignalSpy>
#include <QEvent>
#include <QStyleHints>
@@ -1237,6 +1238,7 @@ void tst_QWindow::testInputEvents()
window.setGeometry(QRect(m_availableTopLeft + QPoint(80, 80), m_testWindowSize));
window.showNormal();
QTRY_VERIFY(window.isActive());
+ QVERIFY(QTestPrivate::ensurePositionTopLeft(&window));
QTest::keyClick(&window, Qt::Key_A, Qt::NoModifier);
QCoreApplication::processEvents();