Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/move_resize_window_test.cpp
Show All 22 Lines | |||||
23 | #include "platform.h" | 23 | #include "platform.h" | ||
24 | #include "abstract_client.h" | 24 | #include "abstract_client.h" | ||
25 | #include "x11client.h" | 25 | #include "x11client.h" | ||
26 | #include "cursor.h" | 26 | #include "cursor.h" | ||
27 | #include "effects.h" | 27 | #include "effects.h" | ||
28 | #include "screens.h" | 28 | #include "screens.h" | ||
29 | #include "wayland_server.h" | 29 | #include "wayland_server.h" | ||
30 | #include "workspace.h" | 30 | #include "workspace.h" | ||
31 | #include "xdgshellclient.h" | | |||
32 | #include "deleted.h" | 31 | #include "deleted.h" | ||
33 | 32 | | |||
34 | #include <KWayland/Client/connection_thread.h> | 33 | #include <KWayland/Client/connection_thread.h> | ||
35 | #include <KWayland/Client/compositor.h> | 34 | #include <KWayland/Client/compositor.h> | ||
36 | #include <KWayland/Client/pointer.h> | 35 | #include <KWayland/Client/pointer.h> | ||
37 | #include <KWayland/Client/plasmashell.h> | 36 | #include <KWayland/Client/plasmashell.h> | ||
38 | #include <KWayland/Client/seat.h> | 37 | #include <KWayland/Client/seat.h> | ||
39 | #include <KWayland/Client/xdgshell.h> | 38 | #include <KWayland/Client/xdgshell.h> | ||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 87 | private: | |||
89 | KWayland::Client::ConnectionThread *m_connection = nullptr; | 88 | KWayland::Client::ConnectionThread *m_connection = nullptr; | ||
90 | KWayland::Client::Compositor *m_compositor = nullptr; | 89 | KWayland::Client::Compositor *m_compositor = nullptr; | ||
91 | }; | 90 | }; | ||
92 | 91 | | |||
93 | void MoveResizeWindowTest::initTestCase() | 92 | void MoveResizeWindowTest::initTestCase() | ||
94 | { | 93 | { | ||
95 | qRegisterMetaType<KWin::AbstractClient *>(); | 94 | qRegisterMetaType<KWin::AbstractClient *>(); | ||
96 | qRegisterMetaType<KWin::Deleted *>(); | 95 | qRegisterMetaType<KWin::Deleted *>(); | ||
97 | qRegisterMetaType<KWin::XdgShellClient *>(); | | |||
98 | qRegisterMetaType<KWin::MaximizeMode>("MaximizeMode"); | 96 | qRegisterMetaType<KWin::MaximizeMode>("MaximizeMode"); | ||
99 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | 97 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | ||
100 | QVERIFY(workspaceCreatedSpy.isValid()); | 98 | QVERIFY(workspaceCreatedSpy.isValid()); | ||
101 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | 99 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | ||
102 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | 100 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | ||
103 | kwinApp()->start(); | 101 | kwinApp()->start(); | ||
104 | QVERIFY(workspaceCreatedSpy.wait()); | 102 | QVERIFY(workspaceCreatedSpy.wait()); | ||
105 | QCOMPARE(screens()->count(), 1); | 103 | QCOMPARE(screens()->count(), 1); | ||
▲ Show 20 Lines • Show All 703 Lines • ▼ Show 20 Line(s) | 743 | { | |||
809 | QSignalSpy panelClosedSpy(panel, &X11Client::windowClosed); | 807 | QSignalSpy panelClosedSpy(panel, &X11Client::windowClosed); | ||
810 | QVERIFY(panelClosedSpy.isValid()); | 808 | QVERIFY(panelClosedSpy.isValid()); | ||
811 | QVERIFY(panelClosedSpy.wait()); | 809 | QVERIFY(panelClosedSpy.wait()); | ||
812 | 810 | | |||
813 | // snap once more | 811 | // snap once more | ||
814 | QCOMPARE(Workspace::self()->adjustClientPosition(testWindow, targetPoint, false), targetPoint); | 812 | QCOMPARE(Workspace::self()->adjustClientPosition(testWindow, targetPoint, false), targetPoint); | ||
815 | 813 | | |||
816 | // and close | 814 | // and close | ||
817 | QSignalSpy windowClosedSpy(testWindow, &XdgShellClient::windowClosed); | 815 | QSignalSpy windowClosedSpy(testWindow, &AbstractClient::windowClosed); | ||
818 | QVERIFY(windowClosedSpy.isValid()); | 816 | QVERIFY(windowClosedSpy.isValid()); | ||
819 | shellSurface.reset(); | 817 | shellSurface.reset(); | ||
820 | surface.reset(); | 818 | surface.reset(); | ||
821 | QVERIFY(windowClosedSpy.wait()); | 819 | QVERIFY(windowClosedSpy.wait()); | ||
822 | } | 820 | } | ||
823 | 821 | | |||
824 | void MoveResizeWindowTest::testAdjustClientGeometryOfAutohidingWaylandPanel_data() | 822 | void MoveResizeWindowTest::testAdjustClientGeometryOfAutohidingWaylandPanel_data() | ||
825 | { | 823 | { | ||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 835 | { | |||
875 | QVERIFY(panelHiddenSpy.isValid()); | 873 | QVERIFY(panelHiddenSpy.isValid()); | ||
876 | plasmaSurface->requestHideAutoHidingPanel(); | 874 | plasmaSurface->requestHideAutoHidingPanel(); | ||
877 | QVERIFY(panelHiddenSpy.wait()); | 875 | QVERIFY(panelHiddenSpy.wait()); | ||
878 | 876 | | |||
879 | // now try to snap again | 877 | // now try to snap again | ||
880 | QCOMPARE(Workspace::self()->adjustClientPosition(testWindow, targetPoint, false), targetPoint); | 878 | QCOMPARE(Workspace::self()->adjustClientPosition(testWindow, targetPoint, false), targetPoint); | ||
881 | 879 | | |||
882 | // and destroy the panel again | 880 | // and destroy the panel again | ||
883 | QSignalSpy panelClosedSpy(panel, &XdgShellClient::windowClosed); | 881 | QSignalSpy panelClosedSpy(panel, &AbstractClient::windowClosed); | ||
884 | QVERIFY(panelClosedSpy.isValid()); | 882 | QVERIFY(panelClosedSpy.isValid()); | ||
885 | plasmaSurface.reset(); | 883 | plasmaSurface.reset(); | ||
886 | panelShellSurface.reset(); | 884 | panelShellSurface.reset(); | ||
887 | panelSurface.reset(); | 885 | panelSurface.reset(); | ||
888 | QVERIFY(panelClosedSpy.wait()); | 886 | QVERIFY(panelClosedSpy.wait()); | ||
889 | 887 | | |||
890 | // snap once more | 888 | // snap once more | ||
891 | QCOMPARE(Workspace::self()->adjustClientPosition(testWindow, targetPoint, false), targetPoint); | 889 | QCOMPARE(Workspace::self()->adjustClientPosition(testWindow, targetPoint, false), targetPoint); | ||
892 | 890 | | |||
893 | // and close | 891 | // and close | ||
894 | QSignalSpy windowClosedSpy(testWindow, &XdgShellClient::windowClosed); | 892 | QSignalSpy windowClosedSpy(testWindow, &AbstractClient::windowClosed); | ||
895 | QVERIFY(windowClosedSpy.isValid()); | 893 | QVERIFY(windowClosedSpy.isValid()); | ||
896 | shellSurface.reset(); | 894 | shellSurface.reset(); | ||
897 | surface.reset(); | 895 | surface.reset(); | ||
898 | QVERIFY(windowClosedSpy.wait()); | 896 | QVERIFY(windowClosedSpy.wait()); | ||
899 | } | 897 | } | ||
900 | 898 | | |||
901 | void MoveResizeWindowTest::testResizeForVirtualKeyboard() | 899 | void MoveResizeWindowTest::testResizeForVirtualKeyboard() | ||
902 | { | 900 | { | ||
Show All 10 Lines | |||||
913 | QVERIFY(client); | 911 | QVERIFY(client); | ||
914 | 912 | | |||
915 | // The client should receive a configure event upon becoming active. | 913 | // The client should receive a configure event upon becoming active. | ||
916 | QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); | 914 | QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); | ||
917 | QVERIFY(configureRequestedSpy.isValid()); | 915 | QVERIFY(configureRequestedSpy.isValid()); | ||
918 | QVERIFY(configureRequestedSpy.wait()); | 916 | QVERIFY(configureRequestedSpy.wait()); | ||
919 | 917 | | |||
920 | client->move(100, 300); | 918 | client->move(100, 300); | ||
921 | QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged); | 919 | QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); | ||
922 | QVERIFY(frameGeometryChangedSpy.isValid()); | 920 | QVERIFY(frameGeometryChangedSpy.isValid()); | ||
923 | 921 | | |||
924 | QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); | 922 | QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); | ||
925 | client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); | 923 | client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); | ||
926 | QVERIFY(configureRequestedSpy.wait()); | 924 | QVERIFY(configureRequestedSpy.wait()); | ||
927 | 925 | | |||
928 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | 926 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | ||
929 | // render at the new size | 927 | // render at the new size | ||
Show All 26 Lines | 943 | { | |||
956 | QVERIFY(client); | 954 | QVERIFY(client); | ||
957 | 955 | | |||
958 | // The client should receive a configure event upon becoming active. | 956 | // The client should receive a configure event upon becoming active. | ||
959 | QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); | 957 | QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); | ||
960 | QVERIFY(configureRequestedSpy.isValid()); | 958 | QVERIFY(configureRequestedSpy.isValid()); | ||
961 | QVERIFY(configureRequestedSpy.wait()); | 959 | QVERIFY(configureRequestedSpy.wait()); | ||
962 | 960 | | |||
963 | client->move(100, 300); | 961 | client->move(100, 300); | ||
964 | QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged); | 962 | QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); | ||
965 | QVERIFY(frameGeometryChangedSpy.isValid()); | 963 | QVERIFY(frameGeometryChangedSpy.isValid()); | ||
966 | 964 | | |||
967 | QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); | 965 | QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); | ||
968 | client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); | 966 | client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); | ||
969 | QVERIFY(configureRequestedSpy.wait()); | 967 | QVERIFY(configureRequestedSpy.wait()); | ||
970 | 968 | | |||
971 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | 969 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | ||
972 | // render at the new size | 970 | // render at the new size | ||
Show All 34 Lines | 994 | { | |||
1007 | QVERIFY(client); | 1005 | QVERIFY(client); | ||
1008 | 1006 | | |||
1009 | // The client should receive a configure event upon becoming active. | 1007 | // The client should receive a configure event upon becoming active. | ||
1010 | QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); | 1008 | QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); | ||
1011 | QVERIFY(configureRequestedSpy.isValid()); | 1009 | QVERIFY(configureRequestedSpy.isValid()); | ||
1012 | QVERIFY(configureRequestedSpy.wait()); | 1010 | QVERIFY(configureRequestedSpy.wait()); | ||
1013 | 1011 | | |||
1014 | client->move(100, 300); | 1012 | client->move(100, 300); | ||
1015 | QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged); | 1013 | QSignalSpy frameGeometryChangedSpy(client, &AbstractClient::frameGeometryChanged); | ||
1016 | QVERIFY(frameGeometryChangedSpy.isValid()); | 1014 | QVERIFY(frameGeometryChangedSpy.isValid()); | ||
1017 | 1015 | | |||
1018 | QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); | 1016 | QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); | ||
1019 | client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); | 1017 | client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); | ||
1020 | QVERIFY(configureRequestedSpy.wait()); | 1018 | QVERIFY(configureRequestedSpy.wait()); | ||
1021 | 1019 | | |||
1022 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | 1020 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | ||
1023 | // render at the new size | 1021 | // render at the new size | ||
Show All 24 Lines | 1044 | { | |||
1048 | // the associated client is destroyed. | 1046 | // the associated client is destroyed. | ||
1049 | 1047 | | |||
1050 | // Create the test client. | 1048 | // Create the test client. | ||
1051 | using namespace KWayland::Client; | 1049 | using namespace KWayland::Client; | ||
1052 | QScopedPointer<Surface> surface(Test::createSurface()); | 1050 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
1053 | QVERIFY(!surface.isNull()); | 1051 | QVERIFY(!surface.isNull()); | ||
1054 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | 1052 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | ||
1055 | QVERIFY(!shellSurface.isNull()); | 1053 | QVERIFY(!shellSurface.isNull()); | ||
1056 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | 1054 | AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | ||
1057 | QVERIFY(client); | 1055 | QVERIFY(client); | ||
1058 | 1056 | | |||
1059 | // Start moving the client. | 1057 | // Start moving the client. | ||
1060 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | 1058 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | ||
1061 | QVERIFY(clientStartMoveResizedSpy.isValid()); | 1059 | QVERIFY(clientStartMoveResizedSpy.isValid()); | ||
1062 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | 1060 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | ||
1063 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | 1061 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | ||
1064 | 1062 | | |||
Show All 20 Lines | 1081 | { | |||
1085 | // the associated client is destroyed. | 1083 | // the associated client is destroyed. | ||
1086 | 1084 | | |||
1087 | // Create the test client. | 1085 | // Create the test client. | ||
1088 | using namespace KWayland::Client; | 1086 | using namespace KWayland::Client; | ||
1089 | QScopedPointer<Surface> surface(Test::createSurface()); | 1087 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
1090 | QVERIFY(!surface.isNull()); | 1088 | QVERIFY(!surface.isNull()); | ||
1091 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | 1089 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | ||
1092 | QVERIFY(!shellSurface.isNull()); | 1090 | QVERIFY(!shellSurface.isNull()); | ||
1093 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | 1091 | AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | ||
1094 | QVERIFY(client); | 1092 | QVERIFY(client); | ||
1095 | 1093 | | |||
1096 | // Start resizing the client. | 1094 | // Start resizing the client. | ||
1097 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | 1095 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | ||
1098 | QVERIFY(clientStartMoveResizedSpy.isValid()); | 1096 | QVERIFY(clientStartMoveResizedSpy.isValid()); | ||
1099 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | 1097 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | ||
1100 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | 1098 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | ||
1101 | 1099 | | |||
Show All 20 Lines | 1118 | { | |||
1122 | // the associated client is unmapped. | 1120 | // the associated client is unmapped. | ||
1123 | 1121 | | |||
1124 | // Create the test client. | 1122 | // Create the test client. | ||
1125 | using namespace KWayland::Client; | 1123 | using namespace KWayland::Client; | ||
1126 | QScopedPointer<Surface> surface(Test::createSurface()); | 1124 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
1127 | QVERIFY(!surface.isNull()); | 1125 | QVERIFY(!surface.isNull()); | ||
1128 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | 1126 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | ||
1129 | QVERIFY(!shellSurface.isNull()); | 1127 | QVERIFY(!shellSurface.isNull()); | ||
1130 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | 1128 | AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | ||
1131 | QVERIFY(client); | 1129 | QVERIFY(client); | ||
1132 | 1130 | | |||
1133 | // Start resizing the client. | 1131 | // Start resizing the client. | ||
1134 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | 1132 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | ||
1135 | QVERIFY(clientStartMoveResizedSpy.isValid()); | 1133 | QVERIFY(clientStartMoveResizedSpy.isValid()); | ||
1136 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | 1134 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | ||
1137 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | 1135 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | ||
1138 | 1136 | | |||
1139 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | 1137 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | ||
1140 | QCOMPARE(client->isMove(), false); | 1138 | QCOMPARE(client->isMove(), false); | ||
1141 | QCOMPARE(client->isResize(), false); | 1139 | QCOMPARE(client->isResize(), false); | ||
1142 | workspace()->slotWindowMove(); | 1140 | workspace()->slotWindowMove(); | ||
1143 | QCOMPARE(clientStartMoveResizedSpy.count(), 1); | 1141 | QCOMPARE(clientStartMoveResizedSpy.count(), 1); | ||
1144 | QCOMPARE(workspace()->moveResizeClient(), client); | 1142 | QCOMPARE(workspace()->moveResizeClient(), client); | ||
1145 | QCOMPARE(client->isMove(), true); | 1143 | QCOMPARE(client->isMove(), true); | ||
1146 | QCOMPARE(client->isResize(), false); | 1144 | QCOMPARE(client->isResize(), false); | ||
1147 | 1145 | | |||
1148 | // Unmap the client while we're moving it. | 1146 | // Unmap the client while we're moving it. | ||
1149 | QSignalSpy hiddenSpy(client, &XdgShellClient::windowHidden); | 1147 | QSignalSpy hiddenSpy(client, &AbstractClient::windowHidden); | ||
1150 | QVERIFY(hiddenSpy.isValid()); | 1148 | QVERIFY(hiddenSpy.isValid()); | ||
1151 | surface->attachBuffer(Buffer::Ptr()); | 1149 | surface->attachBuffer(Buffer::Ptr()); | ||
1152 | surface->commit(Surface::CommitFlag::None); | 1150 | surface->commit(Surface::CommitFlag::None); | ||
1153 | QVERIFY(hiddenSpy.wait()); | 1151 | QVERIFY(hiddenSpy.wait()); | ||
1154 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | 1152 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | ||
1155 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | 1153 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | ||
1156 | QCOMPARE(client->isMove(), false); | 1154 | QCOMPARE(client->isMove(), false); | ||
1157 | QCOMPARE(client->isResize(), false); | 1155 | QCOMPARE(client->isResize(), false); | ||
Show All 10 Lines | 1164 | { | |||
1168 | // the associated client is unmapped. | 1166 | // the associated client is unmapped. | ||
1169 | 1167 | | |||
1170 | // Create the test client. | 1168 | // Create the test client. | ||
1171 | using namespace KWayland::Client; | 1169 | using namespace KWayland::Client; | ||
1172 | QScopedPointer<Surface> surface(Test::createSurface()); | 1170 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
1173 | QVERIFY(!surface.isNull()); | 1171 | QVERIFY(!surface.isNull()); | ||
1174 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | 1172 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | ||
1175 | QVERIFY(!shellSurface.isNull()); | 1173 | QVERIFY(!shellSurface.isNull()); | ||
1176 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | 1174 | AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | ||
1177 | QVERIFY(client); | 1175 | QVERIFY(client); | ||
1178 | 1176 | | |||
1179 | // Start resizing the client. | 1177 | // Start resizing the client. | ||
1180 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | 1178 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | ||
1181 | QVERIFY(clientStartMoveResizedSpy.isValid()); | 1179 | QVERIFY(clientStartMoveResizedSpy.isValid()); | ||
1182 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | 1180 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | ||
1183 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | 1181 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | ||
1184 | 1182 | | |||
1185 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | 1183 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | ||
1186 | QCOMPARE(client->isMove(), false); | 1184 | QCOMPARE(client->isMove(), false); | ||
1187 | QCOMPARE(client->isResize(), false); | 1185 | QCOMPARE(client->isResize(), false); | ||
1188 | workspace()->slotWindowResize(); | 1186 | workspace()->slotWindowResize(); | ||
1189 | QCOMPARE(clientStartMoveResizedSpy.count(), 1); | 1187 | QCOMPARE(clientStartMoveResizedSpy.count(), 1); | ||
1190 | QCOMPARE(workspace()->moveResizeClient(), client); | 1188 | QCOMPARE(workspace()->moveResizeClient(), client); | ||
1191 | QCOMPARE(client->isMove(), false); | 1189 | QCOMPARE(client->isMove(), false); | ||
1192 | QCOMPARE(client->isResize(), true); | 1190 | QCOMPARE(client->isResize(), true); | ||
1193 | 1191 | | |||
1194 | // Unmap the client while we're resizing it. | 1192 | // Unmap the client while we're resizing it. | ||
1195 | QSignalSpy hiddenSpy(client, &XdgShellClient::windowHidden); | 1193 | QSignalSpy hiddenSpy(client, &AbstractClient::windowHidden); | ||
1196 | QVERIFY(hiddenSpy.isValid()); | 1194 | QVERIFY(hiddenSpy.isValid()); | ||
1197 | surface->attachBuffer(Buffer::Ptr()); | 1195 | surface->attachBuffer(Buffer::Ptr()); | ||
1198 | surface->commit(Surface::CommitFlag::None); | 1196 | surface->commit(Surface::CommitFlag::None); | ||
1199 | QVERIFY(hiddenSpy.wait()); | 1197 | QVERIFY(hiddenSpy.wait()); | ||
1200 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | 1198 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | ||
1201 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | 1199 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | ||
1202 | QCOMPARE(client->isMove(), false); | 1200 | QCOMPARE(client->isMove(), false); | ||
1203 | QCOMPARE(client->isResize(), false); | 1201 | QCOMPARE(client->isResize(), false); | ||
Show All 11 Lines |