Fix flaky tst_QWidget::synthMouseDoubleClick on Opensuse

tst_QWidget::synthMouseDoubleClick is flaky on Opensuse. The touchEvent
is not received when the test fails. The window's
position/framePosition taken is the un-updated one as it is offset
by the frame height.

Verify that the window's position/framePosition have been updated
before sending the touchEvent.

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I32ccea55131d32f21288cfa64dbabf43deb8a8d3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
Frédéric Lefebvre 2025-03-26 15:36:01 +01:00 committed by Frederic Lefebvre
parent 98ff325a75
commit d90dfe0560
1 changed files with 2 additions and 0 deletions

View File

@ -12486,6 +12486,8 @@ void tst_QWidget::synthMouseDoubleClick()
widget.setWindowTitle(QLatin1String(QTest::currentTestFunction())); widget.setWindowTitle(QLatin1String(QTest::currentTestFunction()));
widget.show(); widget.show();
QWindow* window = widget.windowHandle(); QWindow* window = widget.windowHandle();
QVERIFY(ensurePositionTopLeft(window));
QVERIFY(QTest::qWaitForWindowExposed(window)); QVERIFY(QTest::qWaitForWindowExposed(window));
// tap once; move slightly from press to release // tap once; move slightly from press to release