Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/xdgshellclient_rules_test.cpp
Show First 20 Lines • Show All 1597 Lines • ▼ Show 20 Line(s) | 1552 | { | |||
---|---|---|---|---|---|
1598 | // We should receive a configure event when the client becomes active. | 1598 | // We should receive a configure event when the client becomes active. | ||
1599 | QVERIFY(configureRequestedSpy->wait()); | 1599 | QVERIFY(configureRequestedSpy->wait()); | ||
1600 | QCOMPARE(configureRequestedSpy->count(), 2); | 1600 | QCOMPARE(configureRequestedSpy->count(), 2); | ||
1601 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | 1601 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | ||
1602 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | 1602 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | ||
1603 | QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); | 1603 | QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); | ||
1604 | 1604 | | |||
1605 | // Any attempt to change the maximized state should not succeed. | 1605 | // Any attempt to change the maximized state should not succeed. | ||
1606 | const QRect oldGeometry = client->geometry(); | 1606 | const QRect oldGeometry = client->frameGeometry(); | ||
1607 | workspace()->slotWindowMaximize(); | 1607 | workspace()->slotWindowMaximize(); | ||
1608 | QVERIFY(!configureRequestedSpy->wait(100)); | 1608 | QVERIFY(!configureRequestedSpy->wait(100)); | ||
1609 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); | 1609 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); | ||
1610 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull); | 1610 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull); | ||
1611 | QCOMPARE(client->geometry(), oldGeometry); | 1611 | QCOMPARE(client->frameGeometry(), oldGeometry); | ||
1612 | 1612 | | |||
1613 | // If we create the client again, the maximized state should still be forced. | 1613 | // If we create the client again, the maximized state should still be forced. | ||
1614 | shellSurface.reset(); | 1614 | shellSurface.reset(); | ||
1615 | surface.reset(); | 1615 | surface.reset(); | ||
1616 | QVERIFY(Test::waitForWindowDestroyed(client)); | 1616 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
1617 | surface.reset(Test::createSurface()); | 1617 | surface.reset(Test::createSurface()); | ||
1618 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | 1618 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | ||
1619 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | 1619 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | ||
▲ Show 20 Lines • Show All 117 Lines • ▼ Show 20 Line(s) | 1654 | { | |||
1737 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | 1737 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | ||
1738 | Test::render(surface.data(), QSize(100, 50), Qt::blue); | 1738 | Test::render(surface.data(), QSize(100, 50), Qt::blue); | ||
1739 | QVERIFY(geometryChangedSpy.wait()); | 1739 | QVERIFY(geometryChangedSpy.wait()); | ||
1740 | QCOMPARE(client->size(), QSize(100, 50)); | 1740 | QCOMPARE(client->size(), QSize(100, 50)); | ||
1741 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); | 1741 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); | ||
1742 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore); | 1742 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore); | ||
1743 | 1743 | | |||
1744 | // The rule should be discarded after it's been applied. | 1744 | // The rule should be discarded after it's been applied. | ||
1745 | const QRect oldGeometry = client->geometry(); | 1745 | const QRect oldGeometry = client->frameGeometry(); | ||
1746 | client->evaluateWindowRules(); | 1746 | client->evaluateWindowRules(); | ||
1747 | QVERIFY(!configureRequestedSpy->wait(100)); | 1747 | QVERIFY(!configureRequestedSpy->wait(100)); | ||
1748 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); | 1748 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); | ||
1749 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore); | 1749 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore); | ||
1750 | QCOMPARE(client->geometry(), oldGeometry); | 1750 | QCOMPARE(client->frameGeometry(), oldGeometry); | ||
1751 | 1751 | | |||
1752 | // Destroy the client. | 1752 | // Destroy the client. | ||
1753 | shellSurface.reset(); | 1753 | shellSurface.reset(); | ||
1754 | surface.reset(); | 1754 | surface.reset(); | ||
1755 | QVERIFY(Test::waitForWindowDestroyed(client)); | 1755 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
1756 | } | 1756 | } | ||
1757 | 1757 | | |||
1758 | TEST_DATA(testMaximizeForceTemporarily) | 1758 | TEST_DATA(testMaximizeForceTemporarily) | ||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | 1761 | { | |||
1807 | // We should receive a configure event when the client becomes active. | 1807 | // We should receive a configure event when the client becomes active. | ||
1808 | QVERIFY(configureRequestedSpy->wait()); | 1808 | QVERIFY(configureRequestedSpy->wait()); | ||
1809 | QCOMPARE(configureRequestedSpy->count(), 2); | 1809 | QCOMPARE(configureRequestedSpy->count(), 2); | ||
1810 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | 1810 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | ||
1811 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | 1811 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | ||
1812 | QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); | 1812 | QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); | ||
1813 | 1813 | | |||
1814 | // Any attempt to change the maximized state should not succeed. | 1814 | // Any attempt to change the maximized state should not succeed. | ||
1815 | const QRect oldGeometry = client->geometry(); | 1815 | const QRect oldGeometry = client->frameGeometry(); | ||
1816 | workspace()->slotWindowMaximize(); | 1816 | workspace()->slotWindowMaximize(); | ||
1817 | QVERIFY(!configureRequestedSpy->wait(100)); | 1817 | QVERIFY(!configureRequestedSpy->wait(100)); | ||
1818 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); | 1818 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); | ||
1819 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull); | 1819 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull); | ||
1820 | QCOMPARE(client->geometry(), oldGeometry); | 1820 | QCOMPARE(client->frameGeometry(), oldGeometry); | ||
1821 | 1821 | | |||
1822 | // The rule should be discarded if we close the client. | 1822 | // The rule should be discarded if we close the client. | ||
1823 | shellSurface.reset(); | 1823 | shellSurface.reset(); | ||
1824 | surface.reset(); | 1824 | surface.reset(); | ||
1825 | QVERIFY(Test::waitForWindowDestroyed(client)); | 1825 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
1826 | surface.reset(Test::createSurface()); | 1826 | surface.reset(Test::createSurface()); | ||
1827 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | 1827 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | ||
1828 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | 1828 | configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); | ||
▲ Show 20 Lines • Show All 2716 Lines • Show Last 20 Lines |