Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/xdgshellclient_rules_test.cpp
Show First 20 Lines • Show All 573 Lines • ▼ Show 20 Line(s) | 553 | { | |||
---|---|---|---|---|---|
574 | group.writeEntry("positionrule", int(Rules::ApplyNow)); | 574 | group.writeEntry("positionrule", int(Rules::ApplyNow)); | ||
575 | group.writeEntry("wmclass", "org.kde.foo"); | 575 | group.writeEntry("wmclass", "org.kde.foo"); | ||
576 | group.writeEntry("wmclasscomplete", false); | 576 | group.writeEntry("wmclasscomplete", false); | ||
577 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | 577 | group.writeEntry("wmclassmatch", int(Rules::ExactMatch)); | ||
578 | group.sync(); | 578 | group.sync(); | ||
579 | RuleBook::self()->setConfig(config); | 579 | RuleBook::self()->setConfig(config); | ||
580 | 580 | | |||
581 | // The client should be moved to the position specified by the rule. | 581 | // The client should be moved to the position specified by the rule. | ||
582 | QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged); | 582 | QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); | ||
583 | QVERIFY(geometryChangedSpy.isValid()); | 583 | QVERIFY(frameGeometryChangedSpy.isValid()); | ||
584 | workspace()->slotReconfigure(); | 584 | workspace()->slotReconfigure(); | ||
585 | QCOMPARE(geometryChangedSpy.count(), 1); | 585 | QCOMPARE(frameGeometryChangedSpy.count(), 1); | ||
586 | QCOMPARE(client->pos(), QPoint(42, 42)); | 586 | QCOMPARE(client->pos(), QPoint(42, 42)); | ||
587 | 587 | | |||
588 | // We still have to be able to move the client around. | 588 | // We still have to be able to move the client around. | ||
589 | QVERIFY(client->isMovable()); | 589 | QVERIFY(client->isMovable()); | ||
590 | QVERIFY(client->isMovableAcrossScreens()); | 590 | QVERIFY(client->isMovableAcrossScreens()); | ||
591 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | 591 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | ||
592 | QVERIFY(clientStartMoveResizedSpy.isValid()); | 592 | QVERIFY(clientStartMoveResizedSpy.isValid()); | ||
593 | QSignalSpy clientStepUserMovedResizedSpy(client, &AbstractClient::clientStepUserMovedResized); | 593 | QSignalSpy clientStepUserMovedResizedSpy(client, &AbstractClient::clientStepUserMovedResized); | ||
▲ Show 20 Lines • Show All 193 Lines • ▼ Show 20 Line(s) | 745 | { | |||
787 | // We should receive a configure event when the client becomes active. | 787 | // We should receive a configure event when the client becomes active. | ||
788 | QVERIFY(configureRequestedSpy->wait()); | 788 | QVERIFY(configureRequestedSpy->wait()); | ||
789 | QCOMPARE(configureRequestedSpy->count(), 2); | 789 | QCOMPARE(configureRequestedSpy->count(), 2); | ||
790 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | 790 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | ||
791 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | 791 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | ||
792 | QVERIFY(!states.testFlag(XdgShellSurface::State::Resizing)); | 792 | QVERIFY(!states.testFlag(XdgShellSurface::State::Resizing)); | ||
793 | 793 | | |||
794 | // One still should be able to resize the client. | 794 | // One still should be able to resize the client. | ||
795 | QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged); | 795 | QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); | ||
796 | QVERIFY(geometryChangedSpy.isValid()); | 796 | QVERIFY(frameGeometryChangedSpy.isValid()); | ||
797 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | 797 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | ||
798 | QVERIFY(clientStartMoveResizedSpy.isValid()); | 798 | QVERIFY(clientStartMoveResizedSpy.isValid()); | ||
799 | QSignalSpy clientStepUserMovedResizedSpy(client, &AbstractClient::clientStepUserMovedResized); | 799 | QSignalSpy clientStepUserMovedResizedSpy(client, &AbstractClient::clientStepUserMovedResized); | ||
800 | QVERIFY(clientStepUserMovedResizedSpy.isValid()); | 800 | QVERIFY(clientStepUserMovedResizedSpy.isValid()); | ||
801 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | 801 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | ||
802 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | 802 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | ||
803 | QSignalSpy surfaceSizeChangedSpy(shellSurface.data(), &XdgShellSurface::sizeChanged); | 803 | QSignalSpy surfaceSizeChangedSpy(shellSurface.data(), &XdgShellSurface::sizeChanged); | ||
804 | QVERIFY(surfaceSizeChangedSpy.isValid()); | 804 | QVERIFY(surfaceSizeChangedSpy.isValid()); | ||
Show All 22 Lines | |||||
827 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | 827 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | ||
828 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | 828 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | ||
829 | QVERIFY(states.testFlag(XdgShellSurface::State::Resizing)); | 829 | QVERIFY(states.testFlag(XdgShellSurface::State::Resizing)); | ||
830 | QCOMPARE(surfaceSizeChangedSpy.count(), 1); | 830 | QCOMPARE(surfaceSizeChangedSpy.count(), 1); | ||
831 | QCOMPARE(surfaceSizeChangedSpy.last().first().toSize(), QSize(488, 640)); | 831 | QCOMPARE(surfaceSizeChangedSpy.last().first().toSize(), QSize(488, 640)); | ||
832 | QCOMPARE(clientStepUserMovedResizedSpy.count(), 0); | 832 | QCOMPARE(clientStepUserMovedResizedSpy.count(), 0); | ||
833 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | 833 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | ||
834 | Test::render(surface.data(), QSize(488, 640), Qt::blue); | 834 | Test::render(surface.data(), QSize(488, 640), Qt::blue); | ||
835 | QVERIFY(geometryChangedSpy.wait()); | 835 | QVERIFY(frameGeometryChangedSpy.wait()); | ||
836 | QCOMPARE(client->size(), QSize(488, 640)); | 836 | QCOMPARE(client->size(), QSize(488, 640)); | ||
837 | QCOMPARE(clientStepUserMovedResizedSpy.count(), 1); | 837 | QCOMPARE(clientStepUserMovedResizedSpy.count(), 1); | ||
838 | 838 | | |||
839 | client->keyPressEvent(Qt::Key_Enter); | 839 | client->keyPressEvent(Qt::Key_Enter); | ||
840 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); | 840 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); | ||
841 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | 841 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | ||
842 | QVERIFY(!client->isMove()); | 842 | QVERIFY(!client->isMove()); | ||
843 | QVERIFY(!client->isResize()); | 843 | QVERIFY(!client->isResize()); | ||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Line(s) | 883 | { | |||
925 | // We should receive a configure event when the client becomes active. | 925 | // We should receive a configure event when the client becomes active. | ||
926 | QVERIFY(configureRequestedSpy->wait()); | 926 | QVERIFY(configureRequestedSpy->wait()); | ||
927 | QCOMPARE(configureRequestedSpy->count(), 2); | 927 | QCOMPARE(configureRequestedSpy->count(), 2); | ||
928 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | 928 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | ||
929 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | 929 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | ||
930 | QVERIFY(!states.testFlag(XdgShellSurface::State::Resizing)); | 930 | QVERIFY(!states.testFlag(XdgShellSurface::State::Resizing)); | ||
931 | 931 | | |||
932 | // One should still be able to resize the client. | 932 | // One should still be able to resize the client. | ||
933 | QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged); | 933 | QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); | ||
934 | QVERIFY(geometryChangedSpy.isValid()); | 934 | QVERIFY(frameGeometryChangedSpy.isValid()); | ||
935 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | 935 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | ||
936 | QVERIFY(clientStartMoveResizedSpy.isValid()); | 936 | QVERIFY(clientStartMoveResizedSpy.isValid()); | ||
937 | QSignalSpy clientStepUserMovedResizedSpy(client, &AbstractClient::clientStepUserMovedResized); | 937 | QSignalSpy clientStepUserMovedResizedSpy(client, &AbstractClient::clientStepUserMovedResized); | ||
938 | QVERIFY(clientStepUserMovedResizedSpy.isValid()); | 938 | QVERIFY(clientStepUserMovedResizedSpy.isValid()); | ||
939 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | 939 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | ||
940 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | 940 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | ||
941 | QSignalSpy surfaceSizeChangedSpy(shellSurface.data(), &XdgShellSurface::sizeChanged); | 941 | QSignalSpy surfaceSizeChangedSpy(shellSurface.data(), &XdgShellSurface::sizeChanged); | ||
942 | QVERIFY(surfaceSizeChangedSpy.isValid()); | 942 | QVERIFY(surfaceSizeChangedSpy.isValid()); | ||
Show All 22 Lines | |||||
965 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | 965 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | ||
966 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | 966 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | ||
967 | QVERIFY(states.testFlag(XdgShellSurface::State::Resizing)); | 967 | QVERIFY(states.testFlag(XdgShellSurface::State::Resizing)); | ||
968 | QCOMPARE(surfaceSizeChangedSpy.count(), 1); | 968 | QCOMPARE(surfaceSizeChangedSpy.count(), 1); | ||
969 | QCOMPARE(surfaceSizeChangedSpy.last().first().toSize(), QSize(488, 640)); | 969 | QCOMPARE(surfaceSizeChangedSpy.last().first().toSize(), QSize(488, 640)); | ||
970 | QCOMPARE(clientStepUserMovedResizedSpy.count(), 0); | 970 | QCOMPARE(clientStepUserMovedResizedSpy.count(), 0); | ||
971 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | 971 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | ||
972 | Test::render(surface.data(), QSize(488, 640), Qt::blue); | 972 | Test::render(surface.data(), QSize(488, 640), Qt::blue); | ||
973 | QVERIFY(geometryChangedSpy.wait()); | 973 | QVERIFY(frameGeometryChangedSpy.wait()); | ||
974 | QCOMPARE(client->size(), QSize(488, 640)); | 974 | QCOMPARE(client->size(), QSize(488, 640)); | ||
975 | QCOMPARE(clientStepUserMovedResizedSpy.count(), 1); | 975 | QCOMPARE(clientStepUserMovedResizedSpy.count(), 1); | ||
976 | 976 | | |||
977 | client->keyPressEvent(Qt::Key_Enter); | 977 | client->keyPressEvent(Qt::Key_Enter); | ||
978 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); | 978 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); | ||
979 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | 979 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | ||
980 | QVERIFY(!client->isMove()); | 980 | QVERIFY(!client->isMove()); | ||
981 | QVERIFY(!client->isResize()); | 981 | QVERIFY(!client->isResize()); | ||
▲ Show 20 Lines • Show All 167 Lines • ▼ Show 20 Line(s) | 1109 | { | |||
1149 | workspace()->slotReconfigure(); | 1149 | workspace()->slotReconfigure(); | ||
1150 | 1150 | | |||
1151 | // The compositor should send a configure event with a new size. | 1151 | // The compositor should send a configure event with a new size. | ||
1152 | QVERIFY(configureRequestedSpy->wait()); | 1152 | QVERIFY(configureRequestedSpy->wait()); | ||
1153 | QCOMPARE(configureRequestedSpy->count(), 3); | 1153 | QCOMPARE(configureRequestedSpy->count(), 3); | ||
1154 | QCOMPARE(configureRequestedSpy->last().first().toSize(), QSize(480, 640)); | 1154 | QCOMPARE(configureRequestedSpy->last().first().toSize(), QSize(480, 640)); | ||
1155 | 1155 | | |||
1156 | // Draw the surface with the new size. | 1156 | // Draw the surface with the new size. | ||
1157 | QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged); | 1157 | QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); | ||
1158 | QVERIFY(geometryChangedSpy.isValid()); | 1158 | QVERIFY(frameGeometryChangedSpy.isValid()); | ||
1159 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | 1159 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | ||
1160 | Test::render(surface.data(), QSize(480, 640), Qt::blue); | 1160 | Test::render(surface.data(), QSize(480, 640), Qt::blue); | ||
1161 | QVERIFY(geometryChangedSpy.wait()); | 1161 | QVERIFY(frameGeometryChangedSpy.wait()); | ||
1162 | QCOMPARE(client->size(), QSize(480, 640)); | 1162 | QCOMPARE(client->size(), QSize(480, 640)); | ||
1163 | QVERIFY(!configureRequestedSpy->wait(100)); | 1163 | QVERIFY(!configureRequestedSpy->wait(100)); | ||
1164 | 1164 | | |||
1165 | // The rule should not be applied again. | 1165 | // The rule should not be applied again. | ||
1166 | client->evaluateWindowRules(); | 1166 | client->evaluateWindowRules(); | ||
1167 | QVERIFY(!configureRequestedSpy->wait(100)); | 1167 | QVERIFY(!configureRequestedSpy->wait(100)); | ||
1168 | 1168 | | |||
1169 | // Destroy the client. | 1169 | // Destroy the client. | ||
▲ Show 20 Lines • Show All 212 Lines • ▼ Show 20 Line(s) | 1328 | { | |||
1382 | workspace()->slotWindowMaximize(); | 1382 | workspace()->slotWindowMaximize(); | ||
1383 | QVERIFY(configureRequestedSpy->wait()); | 1383 | QVERIFY(configureRequestedSpy->wait()); | ||
1384 | QCOMPARE(configureRequestedSpy->count(), 3); | 1384 | QCOMPARE(configureRequestedSpy->count(), 3); | ||
1385 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(0, 0)); | 1385 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(0, 0)); | ||
1386 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | 1386 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | ||
1387 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | 1387 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | ||
1388 | QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized)); | 1388 | QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized)); | ||
1389 | 1389 | | |||
1390 | QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged); | 1390 | QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); | ||
1391 | QVERIFY(geometryChangedSpy.isValid()); | 1391 | QVERIFY(frameGeometryChangedSpy.isValid()); | ||
1392 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | 1392 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | ||
1393 | Test::render(surface.data(), QSize(100, 50), Qt::blue); | 1393 | Test::render(surface.data(), QSize(100, 50), Qt::blue); | ||
1394 | QVERIFY(geometryChangedSpy.wait()); | 1394 | QVERIFY(frameGeometryChangedSpy.wait()); | ||
1395 | QCOMPARE(client->size(), QSize(100, 50)); | 1395 | QCOMPARE(client->size(), QSize(100, 50)); | ||
1396 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); | 1396 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); | ||
1397 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore); | 1397 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore); | ||
1398 | 1398 | | |||
1399 | // If we create the client again, it should be initially maximized. | 1399 | // If we create the client again, it should be initially maximized. | ||
1400 | shellSurface.reset(); | 1400 | shellSurface.reset(); | ||
1401 | surface.reset(); | 1401 | surface.reset(); | ||
1402 | QVERIFY(Test::waitForWindowDestroyed(client)); | 1402 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 1440 | { | |||
1494 | workspace()->slotWindowMaximize(); | 1494 | workspace()->slotWindowMaximize(); | ||
1495 | QVERIFY(configureRequestedSpy->wait()); | 1495 | QVERIFY(configureRequestedSpy->wait()); | ||
1496 | QCOMPARE(configureRequestedSpy->count(), 3); | 1496 | QCOMPARE(configureRequestedSpy->count(), 3); | ||
1497 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(0, 0)); | 1497 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(0, 0)); | ||
1498 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | 1498 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | ||
1499 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | 1499 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | ||
1500 | QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized)); | 1500 | QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized)); | ||
1501 | 1501 | | |||
1502 | QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged); | 1502 | QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); | ||
1503 | QVERIFY(geometryChangedSpy.isValid()); | 1503 | QVERIFY(frameGeometryChangedSpy.isValid()); | ||
1504 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | 1504 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | ||
1505 | Test::render(surface.data(), QSize(100, 50), Qt::blue); | 1505 | Test::render(surface.data(), QSize(100, 50), Qt::blue); | ||
1506 | QVERIFY(geometryChangedSpy.wait()); | 1506 | QVERIFY(frameGeometryChangedSpy.wait()); | ||
1507 | QCOMPARE(client->size(), QSize(100, 50)); | 1507 | QCOMPARE(client->size(), QSize(100, 50)); | ||
1508 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); | 1508 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); | ||
1509 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore); | 1509 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore); | ||
1510 | 1510 | | |||
1511 | // If we create the client again, it should not be maximized (because last time it wasn't). | 1511 | // If we create the client again, it should not be maximized (because last time it wasn't). | ||
1512 | shellSurface.reset(); | 1512 | shellSurface.reset(); | ||
1513 | surface.reset(); | 1513 | surface.reset(); | ||
1514 | QVERIFY(Test::waitForWindowDestroyed(client)); | 1514 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
▲ Show 20 Lines • Show All 193 Lines • ▼ Show 20 Line(s) | 1654 | { | |||
1708 | QVERIFY(configureRequestedSpy->wait()); | 1708 | QVERIFY(configureRequestedSpy->wait()); | ||
1709 | QCOMPARE(configureRequestedSpy->count(), 3); | 1709 | QCOMPARE(configureRequestedSpy->count(), 3); | ||
1710 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024)); | 1710 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024)); | ||
1711 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | 1711 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | ||
1712 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | 1712 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | ||
1713 | QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); | 1713 | QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); | ||
1714 | 1714 | | |||
1715 | // Draw contents of the maximized client. | 1715 | // Draw contents of the maximized client. | ||
1716 | QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged); | 1716 | QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); | ||
1717 | QVERIFY(geometryChangedSpy.isValid()); | 1717 | QVERIFY(frameGeometryChangedSpy.isValid()); | ||
1718 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | 1718 | shellSurface->ackConfigure(configureRequestedSpy->last().at(2).value<quint32>()); | ||
1719 | Test::render(surface.data(), QSize(1280, 1024), Qt::blue); | 1719 | Test::render(surface.data(), QSize(1280, 1024), Qt::blue); | ||
1720 | QVERIFY(geometryChangedSpy.wait()); | 1720 | QVERIFY(frameGeometryChangedSpy.wait()); | ||
1721 | QCOMPARE(client->size(), QSize(1280, 1024)); | 1721 | QCOMPARE(client->size(), QSize(1280, 1024)); | ||
1722 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); | 1722 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); | ||
1723 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull); | 1723 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull); | ||
1724 | 1724 | | |||
1725 | // The client still has to be maximizeable. | 1725 | // The client still has to be maximizeable. | ||
1726 | QVERIFY(client->isMaximizable()); | 1726 | QVERIFY(client->isMaximizable()); | ||
1727 | 1727 | | |||
1728 | // Restore the client. | 1728 | // Restore the client. | ||
1729 | workspace()->slotWindowMaximize(); | 1729 | workspace()->slotWindowMaximize(); | ||
1730 | QVERIFY(configureRequestedSpy->wait()); | 1730 | QVERIFY(configureRequestedSpy->wait()); | ||
1731 | QCOMPARE(configureRequestedSpy->count(), 4); | 1731 | QCOMPARE(configureRequestedSpy->count(), 4); | ||
1732 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(100, 50)); | 1732 | QCOMPARE(configureRequestedSpy->last().at(0).toSize(), QSize(100, 50)); | ||
1733 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | 1733 | states = configureRequestedSpy->last().at(1).value<XdgShellSurface::States>(); | ||
1734 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | 1734 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | ||
1735 | QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized)); | 1735 | QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized)); | ||
1736 | 1736 | | |||
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(frameGeometryChangedSpy.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->frameGeometry(); | 1745 | const QRect oldGeometry = client->frameGeometry(); | ||
1746 | client->evaluateWindowRules(); | 1746 | client->evaluateWindowRules(); | ||
1747 | QVERIFY(!configureRequestedSpy->wait(100)); | 1747 | QVERIFY(!configureRequestedSpy->wait(100)); | ||
▲ Show 20 Lines • Show All 2797 Lines • Show Last 20 Lines |