Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/move_resize_window_test.cpp
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Line(s) | 125 | { | |||
---|---|---|---|---|---|
133 | QSignalSpy sizeChangeSpy(shellSurface.data(), &XdgShellSurface::sizeChanged); | 133 | QSignalSpy sizeChangeSpy(shellSurface.data(), &XdgShellSurface::sizeChanged); | ||
134 | QVERIFY(sizeChangeSpy.isValid()); | 134 | QVERIFY(sizeChangeSpy.isValid()); | ||
135 | // let's render | 135 | // let's render | ||
136 | auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | 136 | auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | ||
137 | 137 | | |||
138 | QVERIFY(c); | 138 | QVERIFY(c); | ||
139 | QCOMPARE(workspace()->activeClient(), c); | 139 | QCOMPARE(workspace()->activeClient(), c); | ||
140 | QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); | 140 | QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); | ||
141 | QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged); | | |||
142 | QVERIFY(geometryChangedSpy.isValid()); | | |||
143 | QSignalSpy startMoveResizedSpy(c, &AbstractClient::clientStartUserMovedResized); | 141 | QSignalSpy startMoveResizedSpy(c, &AbstractClient::clientStartUserMovedResized); | ||
144 | QVERIFY(startMoveResizedSpy.isValid()); | 142 | QVERIFY(startMoveResizedSpy.isValid()); | ||
145 | QSignalSpy moveResizedChangedSpy(c, &AbstractClient::moveResizedChanged); | 143 | QSignalSpy moveResizedChangedSpy(c, &AbstractClient::moveResizedChanged); | ||
146 | QVERIFY(moveResizedChangedSpy.isValid()); | 144 | QVERIFY(moveResizedChangedSpy.isValid()); | ||
147 | QSignalSpy clientStepUserMovedResizedSpy(c, &AbstractClient::clientStepUserMovedResized); | 145 | QSignalSpy clientStepUserMovedResizedSpy(c, &AbstractClient::clientStepUserMovedResized); | ||
148 | QVERIFY(clientStepUserMovedResizedSpy.isValid()); | 146 | QVERIFY(clientStepUserMovedResizedSpy.isValid()); | ||
149 | QSignalSpy clientFinishUserMovedResizedSpy(c, &AbstractClient::clientFinishUserMovedResized); | 147 | QSignalSpy clientFinishUserMovedResizedSpy(c, &AbstractClient::clientFinishUserMovedResized); | ||
150 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | 148 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | ||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Line(s) | 206 | { | |||
238 | QCOMPARE(configureRequestedSpy.count(), 2); | 236 | QCOMPARE(configureRequestedSpy.count(), 2); | ||
239 | states = configureRequestedSpy.last().at(1).value<XdgShellSurface::States>(); | 237 | states = configureRequestedSpy.last().at(1).value<XdgShellSurface::States>(); | ||
240 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | 238 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | ||
241 | QVERIFY(!states.testFlag(XdgShellSurface::State::Resizing)); | 239 | QVERIFY(!states.testFlag(XdgShellSurface::State::Resizing)); | ||
242 | 240 | | |||
243 | QVERIFY(c); | 241 | QVERIFY(c); | ||
244 | QCOMPARE(workspace()->activeClient(), c); | 242 | QCOMPARE(workspace()->activeClient(), c); | ||
245 | QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); | 243 | QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 50)); | ||
246 | QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged); | 244 | QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged); | ||
247 | QVERIFY(geometryChangedSpy.isValid()); | 245 | QVERIFY(frameGeometryChangedSpy.isValid()); | ||
248 | QSignalSpy startMoveResizedSpy(c, &AbstractClient::clientStartUserMovedResized); | 246 | QSignalSpy startMoveResizedSpy(c, &AbstractClient::clientStartUserMovedResized); | ||
249 | QVERIFY(startMoveResizedSpy.isValid()); | 247 | QVERIFY(startMoveResizedSpy.isValid()); | ||
250 | QSignalSpy moveResizedChangedSpy(c, &AbstractClient::moveResizedChanged); | 248 | QSignalSpy moveResizedChangedSpy(c, &AbstractClient::moveResizedChanged); | ||
251 | QVERIFY(moveResizedChangedSpy.isValid()); | 249 | QVERIFY(moveResizedChangedSpy.isValid()); | ||
252 | QSignalSpy clientStepUserMovedResizedSpy(c, &AbstractClient::clientStepUserMovedResized); | 250 | QSignalSpy clientStepUserMovedResizedSpy(c, &AbstractClient::clientStepUserMovedResized); | ||
253 | QVERIFY(clientStepUserMovedResizedSpy.isValid()); | 251 | QVERIFY(clientStepUserMovedResizedSpy.isValid()); | ||
254 | QSignalSpy clientFinishUserMovedResizedSpy(c, &AbstractClient::clientFinishUserMovedResized); | 252 | QSignalSpy clientFinishUserMovedResizedSpy(c, &AbstractClient::clientFinishUserMovedResized); | ||
255 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | 253 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | ||
Show All 28 Lines | |||||
284 | QVERIFY(states.testFlag(XdgShellSurface::State::Resizing)); | 282 | QVERIFY(states.testFlag(XdgShellSurface::State::Resizing)); | ||
285 | QCOMPARE(surfaceSizeChangedSpy.count(), 1); | 283 | QCOMPARE(surfaceSizeChangedSpy.count(), 1); | ||
286 | QCOMPARE(surfaceSizeChangedSpy.last().first().toSize(), QSize(108, 50)); | 284 | QCOMPARE(surfaceSizeChangedSpy.last().first().toSize(), QSize(108, 50)); | ||
287 | QCOMPARE(clientStepUserMovedResizedSpy.count(), 0); | 285 | QCOMPARE(clientStepUserMovedResizedSpy.count(), 0); | ||
288 | 286 | | |||
289 | // Now render new size. | 287 | // Now render new size. | ||
290 | shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>()); | 288 | shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>()); | ||
291 | Test::render(surface.data(), QSize(108, 50), Qt::blue); | 289 | Test::render(surface.data(), QSize(108, 50), Qt::blue); | ||
292 | QVERIFY(geometryChangedSpy.wait()); | 290 | QVERIFY(frameGeometryChangedSpy.wait()); | ||
293 | QCOMPARE(c->frameGeometry(), QRect(0, 0, 108, 50)); | 291 | QCOMPARE(c->frameGeometry(), QRect(0, 0, 108, 50)); | ||
294 | QCOMPARE(clientStepUserMovedResizedSpy.count(), 1); | 292 | QCOMPARE(clientStepUserMovedResizedSpy.count(), 1); | ||
295 | 293 | | |||
296 | // Go down. | 294 | // Go down. | ||
297 | c->keyPressEvent(Qt::Key_Down); | 295 | c->keyPressEvent(Qt::Key_Down); | ||
298 | c->updateMoveResize(Cursor::pos()); | 296 | c->updateMoveResize(Cursor::pos()); | ||
299 | QCOMPARE(Cursor::pos(), cursorPos + QPoint(8, 8)); | 297 | QCOMPARE(Cursor::pos(), cursorPos + QPoint(8, 8)); | ||
300 | 298 | | |||
301 | // The client should receive another configure event. | 299 | // The client should receive another configure event. | ||
302 | QVERIFY(configureRequestedSpy.wait()); | 300 | QVERIFY(configureRequestedSpy.wait()); | ||
303 | QCOMPARE(configureRequestedSpy.count(), 5); | 301 | QCOMPARE(configureRequestedSpy.count(), 5); | ||
304 | states = configureRequestedSpy.last().at(1).value<XdgShellSurface::States>(); | 302 | states = configureRequestedSpy.last().at(1).value<XdgShellSurface::States>(); | ||
305 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | 303 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | ||
306 | QVERIFY(states.testFlag(XdgShellSurface::State::Resizing)); | 304 | QVERIFY(states.testFlag(XdgShellSurface::State::Resizing)); | ||
307 | QCOMPARE(surfaceSizeChangedSpy.count(), 2); | 305 | QCOMPARE(surfaceSizeChangedSpy.count(), 2); | ||
308 | QCOMPARE(surfaceSizeChangedSpy.last().first().toSize(), QSize(108, 58)); | 306 | QCOMPARE(surfaceSizeChangedSpy.last().first().toSize(), QSize(108, 58)); | ||
309 | 307 | | |||
310 | // Now render new size. | 308 | // Now render new size. | ||
311 | shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>()); | 309 | shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>()); | ||
312 | Test::render(surface.data(), QSize(108, 58), Qt::blue); | 310 | Test::render(surface.data(), QSize(108, 58), Qt::blue); | ||
313 | QVERIFY(geometryChangedSpy.wait()); | 311 | QVERIFY(frameGeometryChangedSpy.wait()); | ||
314 | QCOMPARE(c->frameGeometry(), QRect(0, 0, 108, 58)); | 312 | QCOMPARE(c->frameGeometry(), QRect(0, 0, 108, 58)); | ||
315 | QCOMPARE(clientStepUserMovedResizedSpy.count(), 2); | 313 | QCOMPARE(clientStepUserMovedResizedSpy.count(), 2); | ||
316 | 314 | | |||
317 | // Let's finalize the resize operation. | 315 | // Let's finalize the resize operation. | ||
318 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | 316 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | ||
319 | c->keyPressEvent(Qt::Key_Enter); | 317 | c->keyPressEvent(Qt::Key_Enter); | ||
320 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); | 318 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); | ||
321 | QCOMPARE(moveResizedChangedSpy.count(), 2); | 319 | QCOMPARE(moveResizedChangedSpy.count(), 2); | ||
▲ Show 20 Lines • Show All 160 Lines • ▼ Show 20 Line(s) | 453 | { | |||
482 | Placement::self()->placeCentered(c, QRect(0, 0, 1280, 1024)); | 480 | Placement::self()->placeCentered(c, QRect(0, 0, 1280, 1024)); | ||
483 | QCOMPARE(c->frameGeometry(), QRect(590, 487, 100, 50)); | 481 | QCOMPARE(c->frameGeometry(), QRect(590, 487, 100, 50)); | ||
484 | 482 | | |||
485 | QFETCH(QString, methodCall); | 483 | QFETCH(QString, methodCall); | ||
486 | QMetaObject::invokeMethod(workspace(), methodCall.toLocal8Bit().constData()); | 484 | QMetaObject::invokeMethod(workspace(), methodCall.toLocal8Bit().constData()); | ||
487 | QVERIFY(sizeChangeSpy.wait()); | 485 | QVERIFY(sizeChangeSpy.wait()); | ||
488 | Test::render(surface.data(), shellSurface->size(), Qt::red); | 486 | Test::render(surface.data(), shellSurface->size(), Qt::red); | ||
489 | 487 | | |||
490 | QSignalSpy geometryChangedSpy(c, &AbstractClient::geometryChanged); | 488 | QSignalSpy frameGeometryChangedSpy(c, &AbstractClient::frameGeometryChanged); | ||
491 | QVERIFY(geometryChangedSpy.isValid()); | 489 | QVERIFY(frameGeometryChangedSpy.isValid()); | ||
492 | m_connection->flush(); | 490 | m_connection->flush(); | ||
493 | QVERIFY(geometryChangedSpy.wait()); | 491 | QVERIFY(frameGeometryChangedSpy.wait()); | ||
494 | QTEST(c->frameGeometry(), "expectedGeometry"); | 492 | QTEST(c->frameGeometry(), "expectedGeometry"); | ||
495 | } | 493 | } | ||
496 | 494 | | |||
497 | void MoveResizeWindowTest::testPointerMoveEnd_data() | 495 | void MoveResizeWindowTest::testPointerMoveEnd_data() | ||
498 | { | 496 | { | ||
499 | QTest::addColumn<int>("additionalButton"); | 497 | QTest::addColumn<int>("additionalButton"); | ||
500 | 498 | | |||
501 | QTest::newRow("BTN_RIGHT") << BTN_RIGHT; | 499 | QTest::newRow("BTN_RIGHT") << BTN_RIGHT; | ||
▲ Show 20 Lines • Show All 413 Lines • ▼ Show 20 Line(s) | 902 | { | |||
915 | QVERIFY(client); | 913 | QVERIFY(client); | ||
916 | 914 | | |||
917 | // The client should receive a configure event upon becoming active. | 915 | // The client should receive a configure event upon becoming active. | ||
918 | QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); | 916 | QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); | ||
919 | QVERIFY(configureRequestedSpy.isValid()); | 917 | QVERIFY(configureRequestedSpy.isValid()); | ||
920 | QVERIFY(configureRequestedSpy.wait()); | 918 | QVERIFY(configureRequestedSpy.wait()); | ||
921 | 919 | | |||
922 | client->move(100, 300); | 920 | client->move(100, 300); | ||
923 | QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged); | 921 | QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged); | ||
924 | QVERIFY(geometryChangedSpy.isValid()); | 922 | QVERIFY(frameGeometryChangedSpy.isValid()); | ||
925 | 923 | | |||
926 | QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); | 924 | QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); | ||
927 | client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); | 925 | client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); | ||
928 | QVERIFY(configureRequestedSpy.wait()); | 926 | QVERIFY(configureRequestedSpy.wait()); | ||
929 | 927 | | |||
930 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | 928 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | ||
931 | // render at the new size | 929 | // render at the new size | ||
932 | Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); | 930 | Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); | ||
933 | QVERIFY(geometryChangedSpy.wait()); | 931 | QVERIFY(frameGeometryChangedSpy.wait()); | ||
934 | 932 | | |||
935 | QCOMPARE(client->frameGeometry(), QRect(100, 0, 500, 101)); | 933 | QCOMPARE(client->frameGeometry(), QRect(100, 0, 500, 101)); | ||
936 | client->setVirtualKeyboardGeometry(QRect()); | 934 | client->setVirtualKeyboardGeometry(QRect()); | ||
937 | QVERIFY(configureRequestedSpy.wait()); | 935 | QVERIFY(configureRequestedSpy.wait()); | ||
938 | 936 | | |||
939 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | 937 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | ||
940 | // render at the new size | 938 | // render at the new size | ||
941 | Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); | 939 | Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); | ||
942 | QVERIFY(geometryChangedSpy.wait()); | 940 | QVERIFY(frameGeometryChangedSpy.wait()); | ||
943 | QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); | 941 | QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); | ||
944 | } | 942 | } | ||
945 | 943 | | |||
946 | void MoveResizeWindowTest::testResizeForVirtualKeyboardWithMaximize() | 944 | void MoveResizeWindowTest::testResizeForVirtualKeyboardWithMaximize() | ||
947 | { | 945 | { | ||
948 | using namespace KWayland::Client; | 946 | using namespace KWayland::Client; | ||
949 | 947 | | |||
950 | QScopedPointer<Surface> surface(Test::createSurface()); | 948 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
951 | QVERIFY(!surface.isNull()); | 949 | QVERIFY(!surface.isNull()); | ||
952 | 950 | | |||
953 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | 951 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | ||
954 | QVERIFY(!shellSurface.isNull()); | 952 | QVERIFY(!shellSurface.isNull()); | ||
955 | 953 | | |||
956 | // let's render | 954 | // let's render | ||
957 | auto client = Test::renderAndWaitForShown(surface.data(), QSize(500, 800), Qt::blue); | 955 | auto client = Test::renderAndWaitForShown(surface.data(), QSize(500, 800), Qt::blue); | ||
958 | QVERIFY(client); | 956 | QVERIFY(client); | ||
959 | 957 | | |||
960 | // The client should receive a configure event upon becoming active. | 958 | // The client should receive a configure event upon becoming active. | ||
961 | QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); | 959 | QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); | ||
962 | QVERIFY(configureRequestedSpy.isValid()); | 960 | QVERIFY(configureRequestedSpy.isValid()); | ||
963 | QVERIFY(configureRequestedSpy.wait()); | 961 | QVERIFY(configureRequestedSpy.wait()); | ||
964 | 962 | | |||
965 | client->move(100, 300); | 963 | client->move(100, 300); | ||
966 | QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged); | 964 | QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged); | ||
967 | QVERIFY(geometryChangedSpy.isValid()); | 965 | QVERIFY(frameGeometryChangedSpy.isValid()); | ||
968 | 966 | | |||
969 | QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); | 967 | QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); | ||
970 | client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); | 968 | client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); | ||
971 | QVERIFY(configureRequestedSpy.wait()); | 969 | QVERIFY(configureRequestedSpy.wait()); | ||
972 | 970 | | |||
973 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | 971 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | ||
974 | // render at the new size | 972 | // render at the new size | ||
975 | Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); | 973 | Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); | ||
976 | QVERIFY(geometryChangedSpy.wait()); | 974 | QVERIFY(frameGeometryChangedSpy.wait()); | ||
977 | QCOMPARE(client->frameGeometry(), QRect(100, 0, 500, 101)); | 975 | QCOMPARE(client->frameGeometry(), QRect(100, 0, 500, 101)); | ||
978 | 976 | | |||
979 | client->setMaximize(true, true); | 977 | client->setMaximize(true, true); | ||
980 | QVERIFY(configureRequestedSpy.wait()); | 978 | QVERIFY(configureRequestedSpy.wait()); | ||
981 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | 979 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | ||
982 | Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); | 980 | Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); | ||
983 | QVERIFY(geometryChangedSpy.wait()); | 981 | QVERIFY(frameGeometryChangedSpy.wait()); | ||
984 | QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024)); | 982 | QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024)); | ||
985 | 983 | | |||
986 | client->setVirtualKeyboardGeometry(QRect()); | 984 | client->setVirtualKeyboardGeometry(QRect()); | ||
987 | QVERIFY(!configureRequestedSpy.wait(10)); | 985 | QVERIFY(!configureRequestedSpy.wait(10)); | ||
988 | 986 | | |||
989 | // render at the size of the configureRequested.. it won't have changed | 987 | // render at the size of the configureRequested.. it won't have changed | ||
990 | Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); | 988 | Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); | ||
991 | QVERIFY(!geometryChangedSpy.wait(10)); | 989 | QVERIFY(!frameGeometryChangedSpy.wait(10)); | ||
992 | 990 | | |||
993 | // Size will NOT be restored | 991 | // Size will NOT be restored | ||
994 | QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024)); | 992 | QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024)); | ||
995 | } | 993 | } | ||
996 | 994 | | |||
997 | void MoveResizeWindowTest::testResizeForVirtualKeyboardWithFullScreen() | 995 | void MoveResizeWindowTest::testResizeForVirtualKeyboardWithFullScreen() | ||
998 | { | 996 | { | ||
999 | using namespace KWayland::Client; | 997 | using namespace KWayland::Client; | ||
Show All 9 Lines | |||||
1009 | QVERIFY(client); | 1007 | QVERIFY(client); | ||
1010 | 1008 | | |||
1011 | // The client should receive a configure event upon becoming active. | 1009 | // The client should receive a configure event upon becoming active. | ||
1012 | QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); | 1010 | QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); | ||
1013 | QVERIFY(configureRequestedSpy.isValid()); | 1011 | QVERIFY(configureRequestedSpy.isValid()); | ||
1014 | QVERIFY(configureRequestedSpy.wait()); | 1012 | QVERIFY(configureRequestedSpy.wait()); | ||
1015 | 1013 | | |||
1016 | client->move(100, 300); | 1014 | client->move(100, 300); | ||
1017 | QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged); | 1015 | QSignalSpy frameGeometryChangedSpy(client, &XdgShellClient::frameGeometryChanged); | ||
1018 | QVERIFY(geometryChangedSpy.isValid()); | 1016 | QVERIFY(frameGeometryChangedSpy.isValid()); | ||
1019 | 1017 | | |||
1020 | QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); | 1018 | QCOMPARE(client->frameGeometry(), QRect(100, 300, 500, 800)); | ||
1021 | client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); | 1019 | client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); | ||
1022 | QVERIFY(configureRequestedSpy.wait()); | 1020 | QVERIFY(configureRequestedSpy.wait()); | ||
1023 | 1021 | | |||
1024 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | 1022 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | ||
1025 | // render at the new size | 1023 | // render at the new size | ||
1026 | Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); | 1024 | Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); | ||
1027 | QVERIFY(geometryChangedSpy.wait()); | 1025 | QVERIFY(frameGeometryChangedSpy.wait()); | ||
1028 | QCOMPARE(client->frameGeometry(), QRect(100, 0, 500, 101)); | 1026 | QCOMPARE(client->frameGeometry(), QRect(100, 0, 500, 101)); | ||
1029 | 1027 | | |||
1030 | client->setFullScreen(true, true); | 1028 | client->setFullScreen(true, true); | ||
1031 | QVERIFY(configureRequestedSpy.wait()); | 1029 | QVERIFY(configureRequestedSpy.wait()); | ||
1032 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | 1030 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | ||
1033 | Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); | 1031 | Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); | ||
1034 | QVERIFY(geometryChangedSpy.wait()); | 1032 | QVERIFY(frameGeometryChangedSpy.wait()); | ||
1035 | QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024)); | 1033 | QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024)); | ||
1036 | 1034 | | |||
1037 | client->setVirtualKeyboardGeometry(QRect()); | 1035 | client->setVirtualKeyboardGeometry(QRect()); | ||
1038 | QVERIFY(!configureRequestedSpy.wait(10)); | 1036 | QVERIFY(!configureRequestedSpy.wait(10)); | ||
1039 | 1037 | | |||
1040 | // render at the size of the configureRequested.. it won't have changed | 1038 | // render at the size of the configureRequested.. it won't have changed | ||
1041 | Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); | 1039 | Test::render(surface.data(), configureRequestedSpy.last().first().toSize(), Qt::blue); | ||
1042 | QVERIFY(!geometryChangedSpy.wait(10)); | 1040 | QVERIFY(!frameGeometryChangedSpy.wait(10)); | ||
1043 | // Size will NOT be restored | 1041 | // Size will NOT be restored | ||
1044 | QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024)); | 1042 | QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024)); | ||
1045 | } | 1043 | } | ||
1046 | 1044 | | |||
1047 | void MoveResizeWindowTest::testDestroyMoveClient() | 1045 | void MoveResizeWindowTest::testDestroyMoveClient() | ||
1048 | { | 1046 | { | ||
1049 | // This test verifies that active move operation gets finished when | 1047 | // This test verifies that active move operation gets finished when | ||
1050 | // the associated client is destroyed. | 1048 | // the associated client is destroyed. | ||
▲ Show 20 Lines • Show All 166 Lines • Show Last 20 Lines |