Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/move_resize_window_test.cpp
Show First 20 Lines • Show All 153 Lines • ▼ Show 20 Line(s) | 126 | { | |||
---|---|---|---|---|---|
154 | QSignalSpy windowStartUserMovedResizedSpy(effects, &EffectsHandler::windowStartUserMovedResized); | 154 | QSignalSpy windowStartUserMovedResizedSpy(effects, &EffectsHandler::windowStartUserMovedResized); | ||
155 | QVERIFY(windowStartUserMovedResizedSpy.isValid()); | 155 | QVERIFY(windowStartUserMovedResizedSpy.isValid()); | ||
156 | QSignalSpy windowStepUserMovedResizedSpy(effects, &EffectsHandler::windowStepUserMovedResized); | 156 | QSignalSpy windowStepUserMovedResizedSpy(effects, &EffectsHandler::windowStepUserMovedResized); | ||
157 | QVERIFY(windowStepUserMovedResizedSpy.isValid()); | 157 | QVERIFY(windowStepUserMovedResizedSpy.isValid()); | ||
158 | QSignalSpy windowFinishUserMovedResizedSpy(effects, &EffectsHandler::windowFinishUserMovedResized); | 158 | QSignalSpy windowFinishUserMovedResizedSpy(effects, &EffectsHandler::windowFinishUserMovedResized); | ||
159 | QVERIFY(windowFinishUserMovedResizedSpy.isValid()); | 159 | QVERIFY(windowFinishUserMovedResizedSpy.isValid()); | ||
160 | 160 | | |||
161 | // begin move | 161 | // begin move | ||
162 | QVERIFY(workspace()->getMovingClient() == nullptr); | 162 | QVERIFY(workspace()->moveResizeClient() == nullptr); | ||
163 | QCOMPARE(c->isMove(), false); | 163 | QCOMPARE(c->isMove(), false); | ||
164 | workspace()->slotWindowMove(); | 164 | workspace()->slotWindowMove(); | ||
165 | QCOMPARE(workspace()->getMovingClient(), c); | 165 | QCOMPARE(workspace()->moveResizeClient(), c); | ||
166 | QCOMPARE(startMoveResizedSpy.count(), 1); | 166 | QCOMPARE(startMoveResizedSpy.count(), 1); | ||
167 | QCOMPARE(moveResizedChangedSpy.count(), 1); | 167 | QCOMPARE(moveResizedChangedSpy.count(), 1); | ||
168 | QCOMPARE(windowStartUserMovedResizedSpy.count(), 1); | 168 | QCOMPARE(windowStartUserMovedResizedSpy.count(), 1); | ||
169 | QCOMPARE(c->isMove(), true); | 169 | QCOMPARE(c->isMove(), true); | ||
170 | QCOMPARE(c->geometryRestore(), QRect(0, 0, 100, 50)); | 170 | QCOMPARE(c->geometryRestore(), QRect(0, 0, 100, 50)); | ||
171 | 171 | | |||
172 | // send some key events, not going through input redirection | 172 | // send some key events, not going through input redirection | ||
173 | const QPoint cursorPos = Cursor::pos(); | 173 | const QPoint cursorPos = Cursor::pos(); | ||
Show All 21 Lines | |||||
195 | // let's end | 195 | // let's end | ||
196 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | 196 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | ||
197 | c->keyPressEvent(Qt::Key_Enter); | 197 | c->keyPressEvent(Qt::Key_Enter); | ||
198 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); | 198 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); | ||
199 | QCOMPARE(moveResizedChangedSpy.count(), 2); | 199 | QCOMPARE(moveResizedChangedSpy.count(), 2); | ||
200 | QCOMPARE(windowFinishUserMovedResizedSpy.count(), 1); | 200 | QCOMPARE(windowFinishUserMovedResizedSpy.count(), 1); | ||
201 | QCOMPARE(c->geometry(), QRect(16, 32, 100, 50)); | 201 | QCOMPARE(c->geometry(), QRect(16, 32, 100, 50)); | ||
202 | QCOMPARE(c->isMove(), false); | 202 | QCOMPARE(c->isMove(), false); | ||
203 | QVERIFY(workspace()->getMovingClient() == nullptr); | 203 | QVERIFY(workspace()->moveResizeClient() == nullptr); | ||
204 | surface.reset(); | 204 | surface.reset(); | ||
205 | QVERIFY(Test::waitForWindowDestroyed(c)); | 205 | QVERIFY(Test::waitForWindowDestroyed(c)); | ||
206 | } | 206 | } | ||
207 | 207 | | |||
208 | void MoveResizeWindowTest::testResize() | 208 | void MoveResizeWindowTest::testResize() | ||
209 | { | 209 | { | ||
210 | // a test case which manually resizes a window | 210 | // a test case which manually resizes a window | ||
211 | using namespace KWayland::Client; | 211 | using namespace KWayland::Client; | ||
Show All 20 Lines | |||||
232 | QSignalSpy moveResizedChangedSpy(c, &AbstractClient::moveResizedChanged); | 232 | QSignalSpy moveResizedChangedSpy(c, &AbstractClient::moveResizedChanged); | ||
233 | QVERIFY(moveResizedChangedSpy.isValid()); | 233 | QVERIFY(moveResizedChangedSpy.isValid()); | ||
234 | QSignalSpy clientStepUserMovedResizedSpy(c, &AbstractClient::clientStepUserMovedResized); | 234 | QSignalSpy clientStepUserMovedResizedSpy(c, &AbstractClient::clientStepUserMovedResized); | ||
235 | QVERIFY(clientStepUserMovedResizedSpy.isValid()); | 235 | QVERIFY(clientStepUserMovedResizedSpy.isValid()); | ||
236 | QSignalSpy clientFinishUserMovedResizedSpy(c, &AbstractClient::clientFinishUserMovedResized); | 236 | QSignalSpy clientFinishUserMovedResizedSpy(c, &AbstractClient::clientFinishUserMovedResized); | ||
237 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | 237 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | ||
238 | 238 | | |||
239 | // begin resize | 239 | // begin resize | ||
240 | QVERIFY(workspace()->getMovingClient() == nullptr); | 240 | QVERIFY(workspace()->moveResizeClient() == nullptr); | ||
241 | QCOMPARE(c->isMove(), false); | 241 | QCOMPARE(c->isMove(), false); | ||
242 | QCOMPARE(c->isResize(), false); | 242 | QCOMPARE(c->isResize(), false); | ||
243 | workspace()->slotWindowResize(); | 243 | workspace()->slotWindowResize(); | ||
244 | QCOMPARE(workspace()->getMovingClient(), c); | 244 | QCOMPARE(workspace()->moveResizeClient(), c); | ||
245 | QCOMPARE(startMoveResizedSpy.count(), 1); | 245 | QCOMPARE(startMoveResizedSpy.count(), 1); | ||
246 | QCOMPARE(moveResizedChangedSpy.count(), 1); | 246 | QCOMPARE(moveResizedChangedSpy.count(), 1); | ||
247 | QCOMPARE(c->isResize(), true); | 247 | QCOMPARE(c->isResize(), true); | ||
248 | QCOMPARE(c->geometryRestore(), QRect(0, 0, 100, 50)); | 248 | QCOMPARE(c->geometryRestore(), QRect(0, 0, 100, 50)); | ||
249 | 249 | | |||
250 | // trigger a change | 250 | // trigger a change | ||
251 | const QPoint cursorPos = Cursor::pos(); | 251 | const QPoint cursorPos = Cursor::pos(); | ||
252 | c->keyPressEvent(Qt::Key_Right); | 252 | c->keyPressEvent(Qt::Key_Right); | ||
Show All 24 Lines | |||||
277 | QCOMPARE(clientStepUserMovedResizedSpy.count(), 2); | 277 | QCOMPARE(clientStepUserMovedResizedSpy.count(), 2); | ||
278 | 278 | | |||
279 | // let's end | 279 | // let's end | ||
280 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | 280 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | ||
281 | c->keyPressEvent(Qt::Key_Enter); | 281 | c->keyPressEvent(Qt::Key_Enter); | ||
282 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); | 282 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); | ||
283 | QCOMPARE(moveResizedChangedSpy.count(), 2); | 283 | QCOMPARE(moveResizedChangedSpy.count(), 2); | ||
284 | QCOMPARE(c->isResize(), false); | 284 | QCOMPARE(c->isResize(), false); | ||
285 | QVERIFY(workspace()->getMovingClient() == nullptr); | 285 | QVERIFY(workspace()->moveResizeClient() == nullptr); | ||
286 | surface.reset(); | 286 | surface.reset(); | ||
287 | QVERIFY(Test::waitForWindowDestroyed(c)); | 287 | QVERIFY(Test::waitForWindowDestroyed(c)); | ||
288 | } | 288 | } | ||
289 | 289 | | |||
290 | void MoveResizeWindowTest::testPackTo_data() | 290 | void MoveResizeWindowTest::testPackTo_data() | ||
291 | { | 291 | { | ||
292 | QTest::addColumn<QString>("methodCall"); | 292 | QTest::addColumn<QString>("methodCall"); | ||
293 | QTest::addColumn<QRect>("expectedGeometry"); | 293 | QTest::addColumn<QRect>("expectedGeometry"); | ||
▲ Show 20 Lines • Show All 357 Lines • ▼ Show 20 Line(s) | 620 | { | |||
651 | QVERIFY(!origGeo.contains(Cursor::pos())); | 651 | QVERIFY(!origGeo.contains(Cursor::pos())); | ||
652 | 652 | | |||
653 | QSignalSpy moveStartSpy(client, &Client::clientStartUserMovedResized); | 653 | QSignalSpy moveStartSpy(client, &Client::clientStartUserMovedResized); | ||
654 | QVERIFY(moveStartSpy.isValid()); | 654 | QVERIFY(moveStartSpy.isValid()); | ||
655 | QSignalSpy moveEndSpy(client, &Client::clientFinishUserMovedResized); | 655 | QSignalSpy moveEndSpy(client, &Client::clientFinishUserMovedResized); | ||
656 | QVERIFY(moveEndSpy.isValid()); | 656 | QVERIFY(moveEndSpy.isValid()); | ||
657 | QSignalSpy moveStepSpy(client, &Client::clientStepUserMovedResized); | 657 | QSignalSpy moveStepSpy(client, &Client::clientStepUserMovedResized); | ||
658 | QVERIFY(moveStepSpy.isValid()); | 658 | QVERIFY(moveStepSpy.isValid()); | ||
659 | QVERIFY(!workspace()->getMovingClient()); | 659 | QVERIFY(!workspace()->moveResizeClient()); | ||
660 | 660 | | |||
661 | // use NETRootInfo to trigger a move request | 661 | // use NETRootInfo to trigger a move request | ||
662 | NETRootInfo root(c.data(), NET::Properties()); | 662 | NETRootInfo root(c.data(), NET::Properties()); | ||
663 | root.moveResizeRequest(w, origGeo.center().x(), origGeo.center().y(), NET::Move); | 663 | root.moveResizeRequest(w, origGeo.center().x(), origGeo.center().y(), NET::Move); | ||
664 | xcb_flush(c.data()); | 664 | xcb_flush(c.data()); | ||
665 | 665 | | |||
666 | QVERIFY(moveStartSpy.wait()); | 666 | QVERIFY(moveStartSpy.wait()); | ||
667 | QCOMPARE(workspace()->getMovingClient(), client); | 667 | QCOMPARE(workspace()->moveResizeClient(), client); | ||
668 | QVERIFY(client->isMove()); | 668 | QVERIFY(client->isMove()); | ||
669 | QCOMPARE(client->geometryRestore(), origGeo); | 669 | QCOMPARE(client->geometryRestore(), origGeo); | ||
670 | QCOMPARE(Cursor::pos(), origGeo.center()); | 670 | QCOMPARE(Cursor::pos(), origGeo.center()); | ||
671 | 671 | | |||
672 | // let's move a step | 672 | // let's move a step | ||
673 | Cursor::setPos(Cursor::pos() + QPoint(10, 10)); | 673 | Cursor::setPos(Cursor::pos() + QPoint(10, 10)); | ||
674 | QCOMPARE(moveStepSpy.count(), 1); | 674 | QCOMPARE(moveStepSpy.count(), 1); | ||
675 | QCOMPARE(moveStepSpy.first().last().toRect(), origGeo.translated(10, 10)); | 675 | QCOMPARE(moveStepSpy.first().last().toRect(), origGeo.translated(10, 10)); | ||
▲ Show 20 Lines • Show All 329 Lines • ▼ Show 20 Line(s) | 994 | { | |||
1005 | QVERIFY(client); | 1005 | QVERIFY(client); | ||
1006 | 1006 | | |||
1007 | // Start moving the client. | 1007 | // Start moving the client. | ||
1008 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | 1008 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | ||
1009 | QVERIFY(clientStartMoveResizedSpy.isValid()); | 1009 | QVERIFY(clientStartMoveResizedSpy.isValid()); | ||
1010 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | 1010 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | ||
1011 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | 1011 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | ||
1012 | 1012 | | |||
1013 | QCOMPARE(workspace()->getMovingClient(), nullptr); | 1013 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | ||
1014 | QCOMPARE(client->isMove(), false); | 1014 | QCOMPARE(client->isMove(), false); | ||
1015 | QCOMPARE(client->isResize(), false); | 1015 | QCOMPARE(client->isResize(), false); | ||
1016 | workspace()->slotWindowMove(); | 1016 | workspace()->slotWindowMove(); | ||
1017 | QCOMPARE(clientStartMoveResizedSpy.count(), 1); | 1017 | QCOMPARE(clientStartMoveResizedSpy.count(), 1); | ||
1018 | QCOMPARE(workspace()->getMovingClient(), client); | 1018 | QCOMPARE(workspace()->moveResizeClient(), client); | ||
1019 | QCOMPARE(client->isMove(), true); | 1019 | QCOMPARE(client->isMove(), true); | ||
1020 | QCOMPARE(client->isResize(), false); | 1020 | QCOMPARE(client->isResize(), false); | ||
1021 | 1021 | | |||
1022 | // Let's pretend that the client crashed. | 1022 | // Let's pretend that the client crashed. | ||
1023 | shellSurface.reset(); | 1023 | shellSurface.reset(); | ||
1024 | surface.reset(); | 1024 | surface.reset(); | ||
1025 | QVERIFY(Test::waitForWindowDestroyed(client)); | 1025 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
1026 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | 1026 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | ||
1027 | QCOMPARE(workspace()->getMovingClient(), nullptr); | 1027 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | ||
1028 | } | 1028 | } | ||
1029 | 1029 | | |||
1030 | void MoveResizeWindowTest::testDestroyResizeClient() | 1030 | void MoveResizeWindowTest::testDestroyResizeClient() | ||
1031 | { | 1031 | { | ||
1032 | // This test verifies that active resize operation gets finished when | 1032 | // This test verifies that active resize operation gets finished when | ||
1033 | // the associated client is destroyed. | 1033 | // the associated client is destroyed. | ||
1034 | 1034 | | |||
1035 | // Create the test client. | 1035 | // Create the test client. | ||
1036 | using namespace KWayland::Client; | 1036 | using namespace KWayland::Client; | ||
1037 | QScopedPointer<Surface> surface(Test::createSurface()); | 1037 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
1038 | QVERIFY(!surface.isNull()); | 1038 | QVERIFY(!surface.isNull()); | ||
1039 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | 1039 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | ||
1040 | QVERIFY(!shellSurface.isNull()); | 1040 | QVERIFY(!shellSurface.isNull()); | ||
1041 | ShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | 1041 | ShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | ||
1042 | QVERIFY(client); | 1042 | QVERIFY(client); | ||
1043 | 1043 | | |||
1044 | // Start resizing the client. | 1044 | // Start resizing the client. | ||
1045 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | 1045 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | ||
1046 | QVERIFY(clientStartMoveResizedSpy.isValid()); | 1046 | QVERIFY(clientStartMoveResizedSpy.isValid()); | ||
1047 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | 1047 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | ||
1048 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | 1048 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | ||
1049 | 1049 | | |||
1050 | QCOMPARE(workspace()->getMovingClient(), nullptr); | 1050 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | ||
1051 | QCOMPARE(client->isMove(), false); | 1051 | QCOMPARE(client->isMove(), false); | ||
1052 | QCOMPARE(client->isResize(), false); | 1052 | QCOMPARE(client->isResize(), false); | ||
1053 | workspace()->slotWindowResize(); | 1053 | workspace()->slotWindowResize(); | ||
1054 | QCOMPARE(clientStartMoveResizedSpy.count(), 1); | 1054 | QCOMPARE(clientStartMoveResizedSpy.count(), 1); | ||
1055 | QCOMPARE(workspace()->getMovingClient(), client); | 1055 | QCOMPARE(workspace()->moveResizeClient(), client); | ||
1056 | QCOMPARE(client->isMove(), false); | 1056 | QCOMPARE(client->isMove(), false); | ||
1057 | QCOMPARE(client->isResize(), true); | 1057 | QCOMPARE(client->isResize(), true); | ||
1058 | 1058 | | |||
1059 | // Let's pretend that the client crashed. | 1059 | // Let's pretend that the client crashed. | ||
1060 | shellSurface.reset(); | 1060 | shellSurface.reset(); | ||
1061 | surface.reset(); | 1061 | surface.reset(); | ||
1062 | QVERIFY(Test::waitForWindowDestroyed(client)); | 1062 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
1063 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | 1063 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | ||
1064 | QCOMPARE(workspace()->getMovingClient(), nullptr); | 1064 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | ||
1065 | } | 1065 | } | ||
1066 | 1066 | | |||
1067 | void MoveResizeWindowTest::testUnmapMoveClient() | 1067 | void MoveResizeWindowTest::testUnmapMoveClient() | ||
1068 | { | 1068 | { | ||
1069 | // This test verifies that active move operation gets cancelled when | 1069 | // This test verifies that active move operation gets cancelled when | ||
1070 | // the associated client is unmapped. | 1070 | // the associated client is unmapped. | ||
1071 | 1071 | | |||
1072 | // Create the test client. | 1072 | // Create the test client. | ||
1073 | using namespace KWayland::Client; | 1073 | using namespace KWayland::Client; | ||
1074 | QScopedPointer<Surface> surface(Test::createSurface()); | 1074 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
1075 | QVERIFY(!surface.isNull()); | 1075 | QVERIFY(!surface.isNull()); | ||
1076 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | 1076 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | ||
1077 | QVERIFY(!shellSurface.isNull()); | 1077 | QVERIFY(!shellSurface.isNull()); | ||
1078 | ShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | 1078 | ShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | ||
1079 | QVERIFY(client); | 1079 | QVERIFY(client); | ||
1080 | 1080 | | |||
1081 | // Start resizing the client. | 1081 | // Start resizing the client. | ||
1082 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | 1082 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | ||
1083 | QVERIFY(clientStartMoveResizedSpy.isValid()); | 1083 | QVERIFY(clientStartMoveResizedSpy.isValid()); | ||
1084 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | 1084 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | ||
1085 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | 1085 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | ||
1086 | 1086 | | |||
1087 | QCOMPARE(workspace()->getMovingClient(), nullptr); | 1087 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | ||
1088 | QCOMPARE(client->isMove(), false); | 1088 | QCOMPARE(client->isMove(), false); | ||
1089 | QCOMPARE(client->isResize(), false); | 1089 | QCOMPARE(client->isResize(), false); | ||
1090 | workspace()->slotWindowMove(); | 1090 | workspace()->slotWindowMove(); | ||
1091 | QCOMPARE(clientStartMoveResizedSpy.count(), 1); | 1091 | QCOMPARE(clientStartMoveResizedSpy.count(), 1); | ||
1092 | QCOMPARE(workspace()->getMovingClient(), client); | 1092 | QCOMPARE(workspace()->moveResizeClient(), client); | ||
1093 | QCOMPARE(client->isMove(), true); | 1093 | QCOMPARE(client->isMove(), true); | ||
1094 | QCOMPARE(client->isResize(), false); | 1094 | QCOMPARE(client->isResize(), false); | ||
1095 | 1095 | | |||
1096 | // Unmap the client while we're moving it. | 1096 | // Unmap the client while we're moving it. | ||
1097 | QSignalSpy hiddenSpy(client, &ShellClient::windowHidden); | 1097 | QSignalSpy hiddenSpy(client, &ShellClient::windowHidden); | ||
1098 | QVERIFY(hiddenSpy.isValid()); | 1098 | QVERIFY(hiddenSpy.isValid()); | ||
1099 | surface->attachBuffer(Buffer::Ptr()); | 1099 | surface->attachBuffer(Buffer::Ptr()); | ||
1100 | surface->commit(Surface::CommitFlag::None); | 1100 | surface->commit(Surface::CommitFlag::None); | ||
1101 | QVERIFY(hiddenSpy.wait()); | 1101 | QVERIFY(hiddenSpy.wait()); | ||
1102 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | 1102 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | ||
1103 | QCOMPARE(workspace()->getMovingClient(), nullptr); | 1103 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | ||
1104 | QCOMPARE(client->isMove(), false); | 1104 | QCOMPARE(client->isMove(), false); | ||
1105 | QCOMPARE(client->isResize(), false); | 1105 | QCOMPARE(client->isResize(), false); | ||
1106 | 1106 | | |||
1107 | // Destroy the client. | 1107 | // Destroy the client. | ||
1108 | shellSurface.reset(); | 1108 | shellSurface.reset(); | ||
1109 | QVERIFY(Test::waitForWindowDestroyed(client)); | 1109 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
1110 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | 1110 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | ||
1111 | } | 1111 | } | ||
Show All 13 Lines | 1114 | { | |||
1125 | QVERIFY(client); | 1125 | QVERIFY(client); | ||
1126 | 1126 | | |||
1127 | // Start resizing the client. | 1127 | // Start resizing the client. | ||
1128 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | 1128 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | ||
1129 | QVERIFY(clientStartMoveResizedSpy.isValid()); | 1129 | QVERIFY(clientStartMoveResizedSpy.isValid()); | ||
1130 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | 1130 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | ||
1131 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | 1131 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | ||
1132 | 1132 | | |||
1133 | QCOMPARE(workspace()->getMovingClient(), nullptr); | 1133 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | ||
1134 | QCOMPARE(client->isMove(), false); | 1134 | QCOMPARE(client->isMove(), false); | ||
1135 | QCOMPARE(client->isResize(), false); | 1135 | QCOMPARE(client->isResize(), false); | ||
1136 | workspace()->slotWindowResize(); | 1136 | workspace()->slotWindowResize(); | ||
1137 | QCOMPARE(clientStartMoveResizedSpy.count(), 1); | 1137 | QCOMPARE(clientStartMoveResizedSpy.count(), 1); | ||
1138 | QCOMPARE(workspace()->getMovingClient(), client); | 1138 | QCOMPARE(workspace()->moveResizeClient(), client); | ||
1139 | QCOMPARE(client->isMove(), false); | 1139 | QCOMPARE(client->isMove(), false); | ||
1140 | QCOMPARE(client->isResize(), true); | 1140 | QCOMPARE(client->isResize(), true); | ||
1141 | 1141 | | |||
1142 | // Unmap the client while we're resizing it. | 1142 | // Unmap the client while we're resizing it. | ||
1143 | QSignalSpy hiddenSpy(client, &ShellClient::windowHidden); | 1143 | QSignalSpy hiddenSpy(client, &ShellClient::windowHidden); | ||
1144 | QVERIFY(hiddenSpy.isValid()); | 1144 | QVERIFY(hiddenSpy.isValid()); | ||
1145 | surface->attachBuffer(Buffer::Ptr()); | 1145 | surface->attachBuffer(Buffer::Ptr()); | ||
1146 | surface->commit(Surface::CommitFlag::None); | 1146 | surface->commit(Surface::CommitFlag::None); | ||
1147 | QVERIFY(hiddenSpy.wait()); | 1147 | QVERIFY(hiddenSpy.wait()); | ||
1148 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | 1148 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | ||
1149 | QCOMPARE(workspace()->getMovingClient(), nullptr); | 1149 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | ||
1150 | QCOMPARE(client->isMove(), false); | 1150 | QCOMPARE(client->isMove(), false); | ||
1151 | QCOMPARE(client->isResize(), false); | 1151 | QCOMPARE(client->isResize(), false); | ||
1152 | 1152 | | |||
1153 | // Destroy the client. | 1153 | // Destroy the client. | ||
1154 | shellSurface.reset(); | 1154 | shellSurface.reset(); | ||
1155 | QVERIFY(Test::waitForWindowDestroyed(client)); | 1155 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
1156 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | 1156 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | ||
1157 | } | 1157 | } | ||
1158 | 1158 | | |||
1159 | } | 1159 | } | ||
1160 | 1160 | | |||
1161 | WAYLANDTEST_MAIN(KWin::MoveResizeWindowTest) | 1161 | WAYLANDTEST_MAIN(KWin::MoveResizeWindowTest) | ||
1162 | #include "move_resize_window_test.moc" | 1162 | #include "move_resize_window_test.moc" |