Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/xdgshellclient_rules_test.cpp
Show First 20 Lines • Show All 834 Lines • ▼ Show 20 Line(s) | 743 | { | |||
---|---|---|---|---|---|
835 | QCOMPARE(clientStepUserMovedResizedSpy.count(), 1); | 835 | QCOMPARE(clientStepUserMovedResizedSpy.count(), 1); | ||
836 | 836 | | |||
837 | client->keyPressEvent(Qt::Key_Enter); | 837 | client->keyPressEvent(Qt::Key_Enter); | ||
838 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); | 838 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); | ||
839 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | 839 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | ||
840 | QVERIFY(!client->isMove()); | 840 | QVERIFY(!client->isMove()); | ||
841 | QVERIFY(!client->isResize()); | 841 | QVERIFY(!client->isResize()); | ||
842 | 842 | | |||
843 | QEXPECT_FAIL("", "Interactive resize is not spec-compliant", Continue); | | |||
844 | QVERIFY(configureRequestedSpy->wait(10)); | 843 | QVERIFY(configureRequestedSpy->wait(10)); | ||
845 | QEXPECT_FAIL("", "Interactive resize is not spec-compliant", Continue); | | |||
846 | QCOMPARE(configureRequestedSpy->count(), 5); | 844 | QCOMPARE(configureRequestedSpy->count(), 5); | ||
847 | 845 | | |||
848 | // The rule should be applied again if the client appears after it's been closed. | 846 | // The rule should be applied again if the client appears after it's been closed. | ||
849 | shellSurface.reset(); | 847 | shellSurface.reset(); | ||
850 | surface.reset(); | 848 | surface.reset(); | ||
851 | QVERIFY(Test::waitForWindowDestroyed(client)); | 849 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
852 | surface.reset(Test::createSurface()); | 850 | surface.reset(Test::createSurface()); | ||
853 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | 851 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | ||
▲ Show 20 Lines • Show All 119 Lines • ▼ Show 20 Line(s) | 879 | { | |||
973 | QCOMPARE(clientStepUserMovedResizedSpy.count(), 1); | 971 | QCOMPARE(clientStepUserMovedResizedSpy.count(), 1); | ||
974 | 972 | | |||
975 | client->keyPressEvent(Qt::Key_Enter); | 973 | client->keyPressEvent(Qt::Key_Enter); | ||
976 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); | 974 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); | ||
977 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | 975 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | ||
978 | QVERIFY(!client->isMove()); | 976 | QVERIFY(!client->isMove()); | ||
979 | QVERIFY(!client->isResize()); | 977 | QVERIFY(!client->isResize()); | ||
980 | 978 | | |||
981 | QEXPECT_FAIL("", "Interactive resize is not spec-compliant", Continue); | | |||
982 | QVERIFY(configureRequestedSpy->wait(10)); | 979 | QVERIFY(configureRequestedSpy->wait(10)); | ||
983 | QEXPECT_FAIL("", "Interactive resize is not spec-compliant", Continue); | | |||
984 | QCOMPARE(configureRequestedSpy->count(), 5); | 980 | QCOMPARE(configureRequestedSpy->count(), 5); | ||
985 | 981 | | |||
986 | // If the client appears again, it should have the last known size. | 982 | // If the client appears again, it should have the last known size. | ||
987 | shellSurface.reset(); | 983 | shellSurface.reset(); | ||
988 | surface.reset(); | 984 | surface.reset(); | ||
989 | QVERIFY(Test::waitForWindowDestroyed(client)); | 985 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
990 | surface.reset(Test::createSurface()); | 986 | surface.reset(Test::createSurface()); | ||
991 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | 987 | shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | ||
▲ Show 20 Lines • Show All 383 Lines • ▼ Show 20 Line(s) | 1322 | { | |||
1375 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | 1371 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | ||
1376 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | 1372 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | ||
1377 | QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); | 1373 | QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); | ||
1378 | 1374 | | |||
1379 | // One should still be able to change the maximized state of the client. | 1375 | // One should still be able to change the maximized state of the client. | ||
1380 | workspace()->slotWindowMaximize(); | 1376 | workspace()->slotWindowMaximize(); | ||
1381 | QVERIFY(configureRequestedSpy->wait()); | 1377 | QVERIFY(configureRequestedSpy->wait()); | ||
1382 | QCOMPARE(configureRequestedSpy->count(), 3); | 1378 | QCOMPARE(configureRequestedSpy->count(), 3); | ||
1379 | QEXPECT_FAIL("", "Geometry restore is set to the first valid geometry", Continue); | ||||
1383 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(0, 0)); | 1380 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(0, 0)); | ||
1384 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | 1381 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | ||
1385 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | 1382 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | ||
1386 | QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized)); | 1383 | QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized)); | ||
1387 | 1384 | | |||
1388 | QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); | 1385 | QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); | ||
1389 | QVERIFY(frameGeometryChangedSpy.isValid()); | 1386 | QVERIFY(frameGeometryChangedSpy.isValid()); | ||
1390 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | 1387 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | ||
▲ Show 20 Lines • Show All 96 Lines • ▼ Show 20 Line(s) | 1435 | { | |||
1487 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | 1484 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | ||
1488 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | 1485 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | ||
1489 | QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); | 1486 | QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); | ||
1490 | 1487 | | |||
1491 | // One should still be able to change the maximized state of the client. | 1488 | // One should still be able to change the maximized state of the client. | ||
1492 | workspace()->slotWindowMaximize(); | 1489 | workspace()->slotWindowMaximize(); | ||
1493 | QVERIFY(configureRequestedSpy->wait()); | 1490 | QVERIFY(configureRequestedSpy->wait()); | ||
1494 | QCOMPARE(configureRequestedSpy->count(), 3); | 1491 | QCOMPARE(configureRequestedSpy->count(), 3); | ||
1492 | QEXPECT_FAIL("", "Geometry restore is set to the first valid geometry", Continue); | ||||
1495 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(0, 0)); | 1493 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(0, 0)); | ||
1496 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | 1494 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | ||
1497 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | 1495 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | ||
1498 | QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized)); | 1496 | QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized)); | ||
1499 | 1497 | | |||
1500 | QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); | 1498 | QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); | ||
1501 | QVERIFY(frameGeometryChangedSpy.isValid()); | 1499 | QVERIFY(frameGeometryChangedSpy.isValid()); | ||
1502 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | 1500 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | ||
▲ Show 20 Lines • Show All 3040 Lines • Show Last 20 Lines |