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 "client.h" | 25 | #include "client.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 "shell_client.h" | 31 | #include "xdgshellclient.h" | ||
32 | #include "deleted.h" | 32 | #include "deleted.h" | ||
33 | 33 | | |||
34 | #include <KWayland/Client/connection_thread.h> | 34 | #include <KWayland/Client/connection_thread.h> | ||
35 | #include <KWayland/Client/compositor.h> | 35 | #include <KWayland/Client/compositor.h> | ||
36 | #include <KWayland/Client/pointer.h> | 36 | #include <KWayland/Client/pointer.h> | ||
37 | #include <KWayland/Client/plasmashell.h> | 37 | #include <KWayland/Client/plasmashell.h> | ||
38 | #include <KWayland/Client/seat.h> | 38 | #include <KWayland/Client/seat.h> | ||
39 | #include <KWayland/Client/xdgshell.h> | 39 | #include <KWayland/Client/xdgshell.h> | ||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 88 | private: | |||
89 | KWayland::Client::ConnectionThread *m_connection = nullptr; | 89 | KWayland::Client::ConnectionThread *m_connection = nullptr; | ||
90 | KWayland::Client::Compositor *m_compositor = nullptr; | 90 | KWayland::Client::Compositor *m_compositor = nullptr; | ||
91 | }; | 91 | }; | ||
92 | 92 | | |||
93 | void MoveResizeWindowTest::initTestCase() | 93 | void MoveResizeWindowTest::initTestCase() | ||
94 | { | 94 | { | ||
95 | qRegisterMetaType<KWin::AbstractClient *>(); | 95 | qRegisterMetaType<KWin::AbstractClient *>(); | ||
96 | qRegisterMetaType<KWin::Deleted *>(); | 96 | qRegisterMetaType<KWin::Deleted *>(); | ||
97 | qRegisterMetaType<KWin::ShellClient *>(); | 97 | qRegisterMetaType<KWin::XdgShellClient *>(); | ||
98 | qRegisterMetaType<KWin::MaximizeMode>("MaximizeMode"); | 98 | qRegisterMetaType<KWin::MaximizeMode>("MaximizeMode"); | ||
99 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | 99 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | ||
100 | QVERIFY(workspaceCreatedSpy.isValid()); | 100 | QVERIFY(workspaceCreatedSpy.isValid()); | ||
101 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | 101 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | ||
102 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | 102 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | ||
103 | kwinApp()->start(); | 103 | kwinApp()->start(); | ||
104 | QVERIFY(workspaceCreatedSpy.wait()); | 104 | QVERIFY(workspaceCreatedSpy.wait()); | ||
105 | QCOMPARE(screens()->count(), 1); | 105 | QCOMPARE(screens()->count(), 1); | ||
▲ Show 20 Lines • Show All 210 Lines • ▼ Show 20 Line(s) | 208 | { | |||
316 | 316 | | |||
317 | // Let's finalize the resize operation. | 317 | // Let's finalize the resize operation. | ||
318 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | 318 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | ||
319 | c->keyPressEvent(Qt::Key_Enter); | 319 | c->keyPressEvent(Qt::Key_Enter); | ||
320 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); | 320 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1); | ||
321 | QCOMPARE(moveResizedChangedSpy.count(), 2); | 321 | QCOMPARE(moveResizedChangedSpy.count(), 2); | ||
322 | QCOMPARE(c->isResize(), false); | 322 | QCOMPARE(c->isResize(), false); | ||
323 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | 323 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | ||
324 | QEXPECT_FAIL("", "ShellClient currently doesn't send final configure event", Abort); | 324 | QEXPECT_FAIL("", "XdgShellClient currently doesn't send final configure event", Abort); | ||
325 | QVERIFY(configureRequestedSpy.wait()); | 325 | QVERIFY(configureRequestedSpy.wait()); | ||
326 | QCOMPARE(configureRequestedSpy.count(), 6); | 326 | QCOMPARE(configureRequestedSpy.count(), 6); | ||
327 | states = configureRequestedSpy.last().at(1).value<XdgShellSurface::States>(); | 327 | states = configureRequestedSpy.last().at(1).value<XdgShellSurface::States>(); | ||
328 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | 328 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | ||
329 | QVERIFY(!states.testFlag(XdgShellSurface::State::Resizing)); | 329 | QVERIFY(!states.testFlag(XdgShellSurface::State::Resizing)); | ||
330 | 330 | | |||
331 | // Destroy the client. | 331 | // Destroy the client. | ||
332 | surface.reset(); | 332 | surface.reset(); | ||
▲ Show 20 Lines • Show All 478 Lines • ▼ Show 20 Line(s) | 747 | { | |||
811 | QSignalSpy panelClosedSpy(panel, &Client::windowClosed); | 811 | QSignalSpy panelClosedSpy(panel, &Client::windowClosed); | ||
812 | QVERIFY(panelClosedSpy.isValid()); | 812 | QVERIFY(panelClosedSpy.isValid()); | ||
813 | QVERIFY(panelClosedSpy.wait()); | 813 | QVERIFY(panelClosedSpy.wait()); | ||
814 | 814 | | |||
815 | // snap once more | 815 | // snap once more | ||
816 | QCOMPARE(Workspace::self()->adjustClientPosition(testWindow, targetPoint, false), targetPoint); | 816 | QCOMPARE(Workspace::self()->adjustClientPosition(testWindow, targetPoint, false), targetPoint); | ||
817 | 817 | | |||
818 | // and close | 818 | // and close | ||
819 | QSignalSpy windowClosedSpy(testWindow, &ShellClient::windowClosed); | 819 | QSignalSpy windowClosedSpy(testWindow, &XdgShellClient::windowClosed); | ||
820 | QVERIFY(windowClosedSpy.isValid()); | 820 | QVERIFY(windowClosedSpy.isValid()); | ||
821 | shellSurface.reset(); | 821 | shellSurface.reset(); | ||
822 | surface.reset(); | 822 | surface.reset(); | ||
823 | QVERIFY(windowClosedSpy.wait()); | 823 | QVERIFY(windowClosedSpy.wait()); | ||
824 | } | 824 | } | ||
825 | 825 | | |||
826 | void MoveResizeWindowTest::testAdjustClientGeometryOfAutohidingWaylandPanel_data() | 826 | void MoveResizeWindowTest::testAdjustClientGeometryOfAutohidingWaylandPanel_data() | ||
827 | { | 827 | { | ||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 839 | { | |||
877 | QVERIFY(panelHiddenSpy.isValid()); | 877 | QVERIFY(panelHiddenSpy.isValid()); | ||
878 | plasmaSurface->requestHideAutoHidingPanel(); | 878 | plasmaSurface->requestHideAutoHidingPanel(); | ||
879 | QVERIFY(panelHiddenSpy.wait()); | 879 | QVERIFY(panelHiddenSpy.wait()); | ||
880 | 880 | | |||
881 | // now try to snap again | 881 | // now try to snap again | ||
882 | QCOMPARE(Workspace::self()->adjustClientPosition(testWindow, targetPoint, false), targetPoint); | 882 | QCOMPARE(Workspace::self()->adjustClientPosition(testWindow, targetPoint, false), targetPoint); | ||
883 | 883 | | |||
884 | // and destroy the panel again | 884 | // and destroy the panel again | ||
885 | QSignalSpy panelClosedSpy(panel, &ShellClient::windowClosed); | 885 | QSignalSpy panelClosedSpy(panel, &XdgShellClient::windowClosed); | ||
886 | QVERIFY(panelClosedSpy.isValid()); | 886 | QVERIFY(panelClosedSpy.isValid()); | ||
887 | plasmaSurface.reset(); | 887 | plasmaSurface.reset(); | ||
888 | panelShellSurface.reset(); | 888 | panelShellSurface.reset(); | ||
889 | panelSurface.reset(); | 889 | panelSurface.reset(); | ||
890 | QVERIFY(panelClosedSpy.wait()); | 890 | QVERIFY(panelClosedSpy.wait()); | ||
891 | 891 | | |||
892 | // snap once more | 892 | // snap once more | ||
893 | QCOMPARE(Workspace::self()->adjustClientPosition(testWindow, targetPoint, false), targetPoint); | 893 | QCOMPARE(Workspace::self()->adjustClientPosition(testWindow, targetPoint, false), targetPoint); | ||
894 | 894 | | |||
895 | // and close | 895 | // and close | ||
896 | QSignalSpy windowClosedSpy(testWindow, &ShellClient::windowClosed); | 896 | QSignalSpy windowClosedSpy(testWindow, &XdgShellClient::windowClosed); | ||
897 | QVERIFY(windowClosedSpy.isValid()); | 897 | QVERIFY(windowClosedSpy.isValid()); | ||
898 | shellSurface.reset(); | 898 | shellSurface.reset(); | ||
899 | surface.reset(); | 899 | surface.reset(); | ||
900 | QVERIFY(windowClosedSpy.wait()); | 900 | QVERIFY(windowClosedSpy.wait()); | ||
901 | } | 901 | } | ||
902 | 902 | | |||
903 | void MoveResizeWindowTest::testResizeForVirtualKeyboard() | 903 | void MoveResizeWindowTest::testResizeForVirtualKeyboard() | ||
904 | { | 904 | { | ||
Show All 10 Lines | |||||
915 | QVERIFY(client); | 915 | QVERIFY(client); | ||
916 | 916 | | |||
917 | // The client should receive a configure event upon becoming active. | 917 | // The client should receive a configure event upon becoming active. | ||
918 | QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); | 918 | QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); | ||
919 | QVERIFY(configureRequestedSpy.isValid()); | 919 | QVERIFY(configureRequestedSpy.isValid()); | ||
920 | QVERIFY(configureRequestedSpy.wait()); | 920 | QVERIFY(configureRequestedSpy.wait()); | ||
921 | 921 | | |||
922 | client->move(100, 300); | 922 | client->move(100, 300); | ||
923 | QSignalSpy geometryChangedSpy(client, &ShellClient::geometryChanged); | 923 | QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged); | ||
924 | QVERIFY(geometryChangedSpy.isValid()); | 924 | QVERIFY(geometryChangedSpy.isValid()); | ||
925 | 925 | | |||
926 | QCOMPARE(client->geometry(), QRect(100, 300, 500, 800)); | 926 | QCOMPARE(client->geometry(), QRect(100, 300, 500, 800)); | ||
927 | client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); | 927 | client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); | ||
928 | QVERIFY(configureRequestedSpy.wait()); | 928 | QVERIFY(configureRequestedSpy.wait()); | ||
929 | 929 | | |||
930 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | 930 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | ||
931 | // render at the new size | 931 | // render at the new size | ||
Show All 26 Lines | 947 | { | |||
958 | QVERIFY(client); | 958 | QVERIFY(client); | ||
959 | 959 | | |||
960 | // The client should receive a configure event upon becoming active. | 960 | // The client should receive a configure event upon becoming active. | ||
961 | QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); | 961 | QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); | ||
962 | QVERIFY(configureRequestedSpy.isValid()); | 962 | QVERIFY(configureRequestedSpy.isValid()); | ||
963 | QVERIFY(configureRequestedSpy.wait()); | 963 | QVERIFY(configureRequestedSpy.wait()); | ||
964 | 964 | | |||
965 | client->move(100, 300); | 965 | client->move(100, 300); | ||
966 | QSignalSpy geometryChangedSpy(client, &ShellClient::geometryChanged); | 966 | QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged); | ||
967 | QVERIFY(geometryChangedSpy.isValid()); | 967 | QVERIFY(geometryChangedSpy.isValid()); | ||
968 | 968 | | |||
969 | QCOMPARE(client->geometry(), QRect(100, 300, 500, 800)); | 969 | QCOMPARE(client->geometry(), QRect(100, 300, 500, 800)); | ||
970 | client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); | 970 | client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); | ||
971 | QVERIFY(configureRequestedSpy.wait()); | 971 | QVERIFY(configureRequestedSpy.wait()); | ||
972 | 972 | | |||
973 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | 973 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | ||
974 | // render at the new size | 974 | // render at the new size | ||
Show All 34 Lines | 998 | { | |||
1009 | QVERIFY(client); | 1009 | QVERIFY(client); | ||
1010 | 1010 | | |||
1011 | // The client should receive a configure event upon becoming active. | 1011 | // The client should receive a configure event upon becoming active. | ||
1012 | QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); | 1012 | QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); | ||
1013 | QVERIFY(configureRequestedSpy.isValid()); | 1013 | QVERIFY(configureRequestedSpy.isValid()); | ||
1014 | QVERIFY(configureRequestedSpy.wait()); | 1014 | QVERIFY(configureRequestedSpy.wait()); | ||
1015 | 1015 | | |||
1016 | client->move(100, 300); | 1016 | client->move(100, 300); | ||
1017 | QSignalSpy geometryChangedSpy(client, &ShellClient::geometryChanged); | 1017 | QSignalSpy geometryChangedSpy(client, &XdgShellClient::geometryChanged); | ||
1018 | QVERIFY(geometryChangedSpy.isValid()); | 1018 | QVERIFY(geometryChangedSpy.isValid()); | ||
1019 | 1019 | | |||
1020 | QCOMPARE(client->geometry(), QRect(100, 300, 500, 800)); | 1020 | QCOMPARE(client->geometry(), QRect(100, 300, 500, 800)); | ||
1021 | client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); | 1021 | client->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500)); | ||
1022 | QVERIFY(configureRequestedSpy.wait()); | 1022 | QVERIFY(configureRequestedSpy.wait()); | ||
1023 | 1023 | | |||
1024 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | 1024 | shellSurface->ackConfigure(configureRequestedSpy.last()[2].toInt()); | ||
1025 | // render at the new size | 1025 | // render at the new size | ||
Show All 24 Lines | 1048 | { | |||
1050 | // the associated client is destroyed. | 1050 | // the associated client is destroyed. | ||
1051 | 1051 | | |||
1052 | // Create the test client. | 1052 | // Create the test client. | ||
1053 | using namespace KWayland::Client; | 1053 | using namespace KWayland::Client; | ||
1054 | QScopedPointer<Surface> surface(Test::createSurface()); | 1054 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
1055 | QVERIFY(!surface.isNull()); | 1055 | QVERIFY(!surface.isNull()); | ||
1056 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | 1056 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | ||
1057 | QVERIFY(!shellSurface.isNull()); | 1057 | QVERIFY(!shellSurface.isNull()); | ||
1058 | ShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | 1058 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | ||
1059 | QVERIFY(client); | 1059 | QVERIFY(client); | ||
1060 | 1060 | | |||
1061 | // Start moving the client. | 1061 | // Start moving the client. | ||
1062 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | 1062 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | ||
1063 | QVERIFY(clientStartMoveResizedSpy.isValid()); | 1063 | QVERIFY(clientStartMoveResizedSpy.isValid()); | ||
1064 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | 1064 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | ||
1065 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | 1065 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | ||
1066 | 1066 | | |||
Show All 20 Lines | 1085 | { | |||
1087 | // the associated client is destroyed. | 1087 | // the associated client is destroyed. | ||
1088 | 1088 | | |||
1089 | // Create the test client. | 1089 | // Create the test client. | ||
1090 | using namespace KWayland::Client; | 1090 | using namespace KWayland::Client; | ||
1091 | QScopedPointer<Surface> surface(Test::createSurface()); | 1091 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
1092 | QVERIFY(!surface.isNull()); | 1092 | QVERIFY(!surface.isNull()); | ||
1093 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | 1093 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | ||
1094 | QVERIFY(!shellSurface.isNull()); | 1094 | QVERIFY(!shellSurface.isNull()); | ||
1095 | ShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | 1095 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | ||
1096 | QVERIFY(client); | 1096 | QVERIFY(client); | ||
1097 | 1097 | | |||
1098 | // Start resizing the client. | 1098 | // Start resizing the client. | ||
1099 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | 1099 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | ||
1100 | QVERIFY(clientStartMoveResizedSpy.isValid()); | 1100 | QVERIFY(clientStartMoveResizedSpy.isValid()); | ||
1101 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | 1101 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | ||
1102 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | 1102 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | ||
1103 | 1103 | | |||
Show All 20 Lines | 1122 | { | |||
1124 | // the associated client is unmapped. | 1124 | // the associated client is unmapped. | ||
1125 | 1125 | | |||
1126 | // Create the test client. | 1126 | // Create the test client. | ||
1127 | using namespace KWayland::Client; | 1127 | using namespace KWayland::Client; | ||
1128 | QScopedPointer<Surface> surface(Test::createSurface()); | 1128 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
1129 | QVERIFY(!surface.isNull()); | 1129 | QVERIFY(!surface.isNull()); | ||
1130 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | 1130 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | ||
1131 | QVERIFY(!shellSurface.isNull()); | 1131 | QVERIFY(!shellSurface.isNull()); | ||
1132 | ShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | 1132 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | ||
1133 | QVERIFY(client); | 1133 | QVERIFY(client); | ||
1134 | 1134 | | |||
1135 | // Start resizing the client. | 1135 | // Start resizing the client. | ||
1136 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | 1136 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | ||
1137 | QVERIFY(clientStartMoveResizedSpy.isValid()); | 1137 | QVERIFY(clientStartMoveResizedSpy.isValid()); | ||
1138 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | 1138 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | ||
1139 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | 1139 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | ||
1140 | 1140 | | |||
1141 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | 1141 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | ||
1142 | QCOMPARE(client->isMove(), false); | 1142 | QCOMPARE(client->isMove(), false); | ||
1143 | QCOMPARE(client->isResize(), false); | 1143 | QCOMPARE(client->isResize(), false); | ||
1144 | workspace()->slotWindowMove(); | 1144 | workspace()->slotWindowMove(); | ||
1145 | QCOMPARE(clientStartMoveResizedSpy.count(), 1); | 1145 | QCOMPARE(clientStartMoveResizedSpy.count(), 1); | ||
1146 | QCOMPARE(workspace()->moveResizeClient(), client); | 1146 | QCOMPARE(workspace()->moveResizeClient(), client); | ||
1147 | QCOMPARE(client->isMove(), true); | 1147 | QCOMPARE(client->isMove(), true); | ||
1148 | QCOMPARE(client->isResize(), false); | 1148 | QCOMPARE(client->isResize(), false); | ||
1149 | 1149 | | |||
1150 | // Unmap the client while we're moving it. | 1150 | // Unmap the client while we're moving it. | ||
1151 | QSignalSpy hiddenSpy(client, &ShellClient::windowHidden); | 1151 | QSignalSpy hiddenSpy(client, &XdgShellClient::windowHidden); | ||
1152 | QVERIFY(hiddenSpy.isValid()); | 1152 | QVERIFY(hiddenSpy.isValid()); | ||
1153 | surface->attachBuffer(Buffer::Ptr()); | 1153 | surface->attachBuffer(Buffer::Ptr()); | ||
1154 | surface->commit(Surface::CommitFlag::None); | 1154 | surface->commit(Surface::CommitFlag::None); | ||
1155 | QVERIFY(hiddenSpy.wait()); | 1155 | QVERIFY(hiddenSpy.wait()); | ||
1156 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | 1156 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | ||
1157 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | 1157 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | ||
1158 | QCOMPARE(client->isMove(), false); | 1158 | QCOMPARE(client->isMove(), false); | ||
1159 | QCOMPARE(client->isResize(), false); | 1159 | QCOMPARE(client->isResize(), false); | ||
Show All 10 Lines | 1168 | { | |||
1170 | // the associated client is unmapped. | 1170 | // the associated client is unmapped. | ||
1171 | 1171 | | |||
1172 | // Create the test client. | 1172 | // Create the test client. | ||
1173 | using namespace KWayland::Client; | 1173 | using namespace KWayland::Client; | ||
1174 | QScopedPointer<Surface> surface(Test::createSurface()); | 1174 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
1175 | QVERIFY(!surface.isNull()); | 1175 | QVERIFY(!surface.isNull()); | ||
1176 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | 1176 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | ||
1177 | QVERIFY(!shellSurface.isNull()); | 1177 | QVERIFY(!shellSurface.isNull()); | ||
1178 | ShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | 1178 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | ||
1179 | QVERIFY(client); | 1179 | QVERIFY(client); | ||
1180 | 1180 | | |||
1181 | // Start resizing the client. | 1181 | // Start resizing the client. | ||
1182 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | 1182 | QSignalSpy clientStartMoveResizedSpy(client, &AbstractClient::clientStartUserMovedResized); | ||
1183 | QVERIFY(clientStartMoveResizedSpy.isValid()); | 1183 | QVERIFY(clientStartMoveResizedSpy.isValid()); | ||
1184 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | 1184 | QSignalSpy clientFinishUserMovedResizedSpy(client, &AbstractClient::clientFinishUserMovedResized); | ||
1185 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | 1185 | QVERIFY(clientFinishUserMovedResizedSpy.isValid()); | ||
1186 | 1186 | | |||
1187 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | 1187 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | ||
1188 | QCOMPARE(client->isMove(), false); | 1188 | QCOMPARE(client->isMove(), false); | ||
1189 | QCOMPARE(client->isResize(), false); | 1189 | QCOMPARE(client->isResize(), false); | ||
1190 | workspace()->slotWindowResize(); | 1190 | workspace()->slotWindowResize(); | ||
1191 | QCOMPARE(clientStartMoveResizedSpy.count(), 1); | 1191 | QCOMPARE(clientStartMoveResizedSpy.count(), 1); | ||
1192 | QCOMPARE(workspace()->moveResizeClient(), client); | 1192 | QCOMPARE(workspace()->moveResizeClient(), client); | ||
1193 | QCOMPARE(client->isMove(), false); | 1193 | QCOMPARE(client->isMove(), false); | ||
1194 | QCOMPARE(client->isResize(), true); | 1194 | QCOMPARE(client->isResize(), true); | ||
1195 | 1195 | | |||
1196 | // Unmap the client while we're resizing it. | 1196 | // Unmap the client while we're resizing it. | ||
1197 | QSignalSpy hiddenSpy(client, &ShellClient::windowHidden); | 1197 | QSignalSpy hiddenSpy(client, &XdgShellClient::windowHidden); | ||
1198 | QVERIFY(hiddenSpy.isValid()); | 1198 | QVERIFY(hiddenSpy.isValid()); | ||
1199 | surface->attachBuffer(Buffer::Ptr()); | 1199 | surface->attachBuffer(Buffer::Ptr()); | ||
1200 | surface->commit(Surface::CommitFlag::None); | 1200 | surface->commit(Surface::CommitFlag::None); | ||
1201 | QVERIFY(hiddenSpy.wait()); | 1201 | QVERIFY(hiddenSpy.wait()); | ||
1202 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | 1202 | QCOMPARE(clientFinishUserMovedResizedSpy.count(), 0); | ||
1203 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | 1203 | QCOMPARE(workspace()->moveResizeClient(), nullptr); | ||
1204 | QCOMPARE(client->isMove(), false); | 1204 | QCOMPARE(client->isMove(), false); | ||
1205 | QCOMPARE(client->isResize(), false); | 1205 | QCOMPARE(client->isResize(), false); | ||
Show All 11 Lines |