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 2ec7a6322f.
Fixes: QTBUG-109746
Pick-to: 6.5 6.4
Change-Id: If0df6b1cf451a7f0dccfc1bb7411e895d7ae29a3
Reviewed-by: Liang Qi <liang.qi@qt.io>
bb10
parent
3b60534ab9
commit
df62cefdcb
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue