Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/shell_client_test.cpp
Show First 20 Lines • Show All 695 Lines • ▼ Show 20 Line(s) | 615 | { | |||
---|---|---|---|---|---|
696 | QVERIFY(fullscreenChangedSpy.wait()); | 696 | QVERIFY(fullscreenChangedSpy.wait()); | ||
697 | if (decoMode == ServerSideDecoration::Mode::Server) { | 697 | if (decoMode == ServerSideDecoration::Mode::Server) { | ||
698 | QVERIFY(sizeChangeRequestedSpy.wait()); | 698 | QVERIFY(sizeChangeRequestedSpy.wait()); | ||
699 | QCOMPARE(sizeChangeRequestedSpy.count(), 2); | 699 | QCOMPARE(sizeChangeRequestedSpy.count(), 2); | ||
700 | } | 700 | } | ||
701 | QCOMPARE(sizeChangeRequestedSpy.last().first().toSize(), QSize(screens()->size(0))); | 701 | QCOMPARE(sizeChangeRequestedSpy.last().first().toSize(), QSize(screens()->size(0))); | ||
702 | // TODO: should switch to fullscreen once it's updated | 702 | // TODO: should switch to fullscreen once it's updated | ||
703 | QVERIFY(c->isFullScreen()); | 703 | QVERIFY(c->isFullScreen()); | ||
704 | QVERIFY(geometryChangedSpy.isEmpty()); | | |||
705 | 704 | | |||
706 | if (xdgShellSurface) { | 705 | if (xdgShellSurface) { | ||
707 | for (const auto &it: configureRequestedSpy) { | 706 | for (const auto &it: configureRequestedSpy) { | ||
708 | xdgShellSurface->ackConfigure(it[2].toInt()); | 707 | xdgShellSurface->ackConfigure(it[2].toInt()); | ||
709 | } | 708 | } | ||
710 | } | 709 | } | ||
711 | // render at the new size | 710 | // render at the new size | ||
712 | Test::render(surface.data(), sizeChangeRequestedSpy.last().first().toSize(), Qt::red); | 711 | Test::render(surface.data(), sizeChangeRequestedSpy.last().first().toSize(), Qt::red); | ||
713 | QVERIFY(geometryChangedSpy.wait()); | 712 | | ||
714 | QCOMPARE(geometryChangedSpy.count(), 1); | | |||
715 | QVERIFY(c->isFullScreen()); | 713 | QVERIFY(c->isFullScreen()); | ||
716 | QVERIFY(!c->isDecorated()); | 714 | QVERIFY(!c->isDecorated()); | ||
717 | QCOMPARE(c->geometry(), QRect(QPoint(0, 0), sizeChangeRequestedSpy.last().first().toSize())); | 715 | QCOMPARE(c->geometry(), QRect(QPoint(0, 0), sizeChangeRequestedSpy.last().first().toSize())); | ||
718 | sizeChangeRequestedSpy.clear(); | 716 | sizeChangeRequestedSpy.clear(); | ||
719 | 717 | | |||
720 | // swap back to normal | 718 | // swap back to normal | ||
721 | switch (type) { | 719 | switch (type) { | ||
722 | case Test::ShellSurfaceType::WlShell: | 720 | case Test::ShellSurfaceType::WlShell: | ||
723 | qobject_cast<ShellSurface*>(shellSurface.data())->setToplevel(); | 721 | qobject_cast<ShellSurface*>(shellSurface.data())->setToplevel(); | ||
724 | break; | 722 | break; | ||
725 | case Test::ShellSurfaceType::XdgShellV5: | 723 | case Test::ShellSurfaceType::XdgShellV5: | ||
726 | case Test::ShellSurfaceType::XdgShellV6: | 724 | case Test::ShellSurfaceType::XdgShellV6: | ||
727 | case Test::ShellSurfaceType::XdgShellStable: | 725 | case Test::ShellSurfaceType::XdgShellStable: | ||
728 | qobject_cast<XdgShellSurface*>(shellSurface.data())->setFullscreen(false); | 726 | qobject_cast<XdgShellSurface*>(shellSurface.data())->setFullscreen(false); | ||
729 | break; | 727 | qobject_cast<XdgShellSurface*>(shellSurface.data())->setMaximized(false); | ||
730 | default: | | |||
731 | Q_UNREACHABLE(); | | |||
732 | break; | 728 | break; | ||
733 | } | 729 | } | ||
734 | QVERIFY(fullscreenChangedSpy.wait()); | 730 | QVERIFY(fullscreenChangedSpy.wait()); | ||
731 | if (decoMode == ServerSideDecoration::Mode::Server) { | ||||
735 | QVERIFY(sizeChangeRequestedSpy.wait()); | 732 | QVERIFY(sizeChangeRequestedSpy.wait()); | ||
736 | QCOMPARE(sizeChangeRequestedSpy.count(), 1); | 733 | // don't check count, XDG might legitimately get two updates | ||
734 | | ||||
735 | // fails as we don't correctly call setMaximize(false) | ||||
736 | // but realistically the only toolkits that support the deco also use XDGShell | ||||
737 | QEXPECT_FAIL("wlShell - deco", "With decoration incorrect geometry requested", Continue); | 737 | QEXPECT_FAIL("wlShell - deco", "With decoration incorrect geometry requested", Continue); | ||
738 | QEXPECT_FAIL("xdgShellV5 - deco", "With decoration incorrect geometry requested", Continue); | 738 | | ||
739 | QEXPECT_FAIL("xdgShellV6 - deco", "With decoration incorrect geometry requested", Continue); | | |||
740 | QCOMPARE(sizeChangeRequestedSpy.last().first().toSize(), QSize(100, 50)); | 739 | QCOMPARE(sizeChangeRequestedSpy.last().first().toSize(), QSize(100, 50)); | ||
740 | } | ||||
741 | // TODO: should switch to fullscreen once it's updated | 741 | // TODO: should switch to fullscreen once it's updated | ||
742 | QVERIFY(!c->isFullScreen()); | 742 | QVERIFY(!c->isFullScreen()); | ||
743 | QCOMPARE(c->isDecorated(), decoMode == ServerSideDecoration::Mode::Server); | 743 | QCOMPARE(c->isDecorated(), decoMode == ServerSideDecoration::Mode::Server); | ||
744 | } | 744 | } | ||
745 | 745 | | |||
746 | void TestShellClient::testWindowOpensLargerThanScreen_data() | 746 | void TestShellClient::testWindowOpensLargerThanScreen_data() | ||
747 | { | 747 | { | ||
748 | QTest::addColumn<Test::ShellSurfaceType>("type"); | 748 | QTest::addColumn<Test::ShellSurfaceType>("type"); | ||
▲ Show 20 Lines • Show All 329 Lines • Show Last 20 Lines |