From 78b5f415559e22b53f95251244369b620483c445 Mon Sep 17 00:00:00 2001 From: Axel Spoerl Date: Tue, 3 Jan 2023 09:44:50 +0100 Subject: [PATCH] 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 (cherry picked from commit df62cefdcb0ea6f644f1560285598ed179bb2bb2) Reviewed-by: Qt Cherry-pick Bot --- .../widgets/kernel/qwidget/tst_qwidget.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index bbec6dbeb49..febea8d8217 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -4548,6 +4548,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()); @@ -4561,7 +4563,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()); @@ -4608,6 +4615,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()); @@ -4644,7 +4653,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); }