Skip tst_QWidget::optimizedResizeMove and ..._topLevel on wayland

Wayland omits optimizations tested in tst_QWidget::optimizedResizeMove()
and optimizedResize_topLevel() under certain circumstances, e.g. on
Ubuntu 22.04 / Gnome. This makes the test functions fail.

This patch skips the test functions on wayland platforms, if an
omission is detected.

This amends 2ec7a6322f465ad7cce3c48096d8912903196ab2.

Fixes: QTBUG-109746
Change-Id: If0df6b1cf451a7f0dccfc1bb7411e895d7ae29a3
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit df62cefdcb0ea6f644f1560285598ed179bb2bb2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Axel Spoerl 2023-01-03 09:44:50 +01:00 committed by Qt Cherry-pick Bot
parent 5d37d86a52
commit 5e560c53dc

View File

@ -4634,6 +4634,8 @@ private:
*/
void tst_QWidget::optimizedResizeMove()
{
const bool wayland = QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive);
QWidget parent;
parent.setPalette(simplePalette());
parent.setWindowTitle(QTest::currentTestFunction());
@ -4647,7 +4649,12 @@ void tst_QWidget::optimizedResizeMove()
QVERIFY(staticWidget.waitForPaintEvent());
staticWidget.move(staticWidget.pos() + QPoint(10, 10));
QVERIFY(!staticWidget.waitForPaintEvent());
if (!wayland) {
QVERIFY(!staticWidget.waitForPaintEvent());
} else {
if (staticWidget.waitForPaintEvent())
QSKIP("Wayland is not optimising paint events. Skipping test.");
}
staticWidget.move(staticWidget.pos() + QPoint(-10, -10));
QVERIFY(!staticWidget.waitForPaintEvent());
@ -4694,6 +4701,8 @@ void tst_QWidget::optimizedResizeMove()
void tst_QWidget::optimizedResize_topLevel()
{
const bool wayland = QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive);
if (QHighDpiScaling::isActive())
QSKIP("Skip due to rounding errors in the regions.");
StaticWidget topLevel(simplePalette());
@ -4730,7 +4739,12 @@ void tst_QWidget::optimizedResize_topLevel()
QVERIFY(topLevel.waitForPaintEvent());
if (m_platform == QStringLiteral("xcb") || m_platform == QStringLiteral("offscreen"))
QSKIP("QTBUG-26424");
QCOMPARE(topLevel.partial, true);
if (!wayland) {
QCOMPARE(topLevel.partial, true);
} else {
if (!topLevel.partial)
QSKIP("Wayland does repaint partially. Skipping test.");
}
QCOMPARE(topLevel.paintedRegion, expectedUpdateRegion);
}