Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/screen_changes_test.cpp
Show First 20 Lines • Show All 122 Lines • ▼ Show 20 Line(s) | 73 | { | |||
---|---|---|---|---|---|
123 | QCOMPARE(outputRemovedSpy.first().first().value<quint32>(), firstOutputId); | 123 | QCOMPARE(outputRemovedSpy.first().first().value<quint32>(), firstOutputId); | ||
124 | 124 | | |||
125 | // let's wait a little bit to ensure we don't get more events | 125 | // let's wait a little bit to ensure we don't get more events | ||
126 | QTest::qWait(100); | 126 | QTest::qWait(100); | ||
127 | QCOMPARE(outputAnnouncedSpy.count(), 2); | 127 | QCOMPARE(outputAnnouncedSpy.count(), 2); | ||
128 | QCOMPARE(outputRemovedSpy.count(), 1); | 128 | QCOMPARE(outputRemovedSpy.count(), 1); | ||
129 | 129 | | |||
130 | // let's create the output objects to ensure they are correct | 130 | // let's create the output objects to ensure they are correct | ||
131 | QScopedPointer<Output> o1(registry.createOutput(outputAnnouncedSpy.first().first().value<quint32>(), outputAnnouncedSpy.first().last().value<quint32>())); | 131 | QScopedPointer<KWayland::Client::Output> o1(registry.createOutput(outputAnnouncedSpy.first().first().value<quint32>(), outputAnnouncedSpy.first().last().value<quint32>())); | ||
132 | QVERIFY(o1->isValid()); | 132 | QVERIFY(o1->isValid()); | ||
133 | QSignalSpy o1ChangedSpy(o1.data(), &Output::changed); | 133 | QSignalSpy o1ChangedSpy(o1.data(), &KWayland::Client::Output::changed); | ||
134 | QVERIFY(o1ChangedSpy.isValid()); | 134 | QVERIFY(o1ChangedSpy.isValid()); | ||
135 | QVERIFY(o1ChangedSpy.wait()); | 135 | QVERIFY(o1ChangedSpy.wait()); | ||
136 | QCOMPARE(o1->geometry(), geometries.at(0)); | 136 | QCOMPARE(o1->geometry(), geometries.at(0)); | ||
137 | QScopedPointer<Output> o2(registry.createOutput(outputAnnouncedSpy.last().first().value<quint32>(), outputAnnouncedSpy.last().last().value<quint32>())); | 137 | QScopedPointer<KWayland::Client::Output> o2(registry.createOutput(outputAnnouncedSpy.last().first().value<quint32>(), outputAnnouncedSpy.last().last().value<quint32>())); | ||
138 | QVERIFY(o2->isValid()); | 138 | QVERIFY(o2->isValid()); | ||
139 | QSignalSpy o2ChangedSpy(o2.data(), &Output::changed); | 139 | QSignalSpy o2ChangedSpy(o2.data(), &KWayland::Client::Output::changed); | ||
140 | QVERIFY(o2ChangedSpy.isValid()); | 140 | QVERIFY(o2ChangedSpy.isValid()); | ||
141 | QVERIFY(o2ChangedSpy.wait()); | 141 | QVERIFY(o2ChangedSpy.wait()); | ||
142 | QCOMPARE(o2->geometry(), geometries.at(1)); | 142 | QCOMPARE(o2->geometry(), geometries.at(1)); | ||
143 | 143 | | |||
144 | //and check XDGOutput is synced | 144 | //and check XDGOutput is synced | ||
145 | QScopedPointer<XdgOutput> xdgO1(xdgOutputManager->getXdgOutput(o1.data())); | 145 | QScopedPointer<XdgOutput> xdgO1(xdgOutputManager->getXdgOutput(o1.data())); | ||
146 | QSignalSpy xdgO1ChangedSpy(xdgO1.data(), &XdgOutput::changed); | 146 | QSignalSpy xdgO1ChangedSpy(xdgO1.data(), &XdgOutput::changed); | ||
147 | QVERIFY(xdgO1ChangedSpy.isValid()); | 147 | QVERIFY(xdgO1ChangedSpy.isValid()); | ||
148 | QVERIFY(xdgO1ChangedSpy.wait()); | 148 | QVERIFY(xdgO1ChangedSpy.wait()); | ||
149 | QCOMPARE(xdgO1->logicalPosition(), geometries.at(0).topLeft()); | 149 | QCOMPARE(xdgO1->logicalPosition(), geometries.at(0).topLeft()); | ||
150 | QCOMPARE(xdgO1->logicalSize(), geometries.at(0).size()); | 150 | QCOMPARE(xdgO1->logicalSize(), geometries.at(0).size()); | ||
151 | QScopedPointer<XdgOutput> xdgO2(xdgOutputManager->getXdgOutput(o2.data())); | 151 | QScopedPointer<XdgOutput> xdgO2(xdgOutputManager->getXdgOutput(o2.data())); | ||
152 | QSignalSpy xdgO2ChangedSpy(xdgO2.data(), &XdgOutput::changed); | 152 | QSignalSpy xdgO2ChangedSpy(xdgO2.data(), &XdgOutput::changed); | ||
153 | QVERIFY(xdgO2ChangedSpy.isValid()); | 153 | QVERIFY(xdgO2ChangedSpy.isValid()); | ||
154 | QVERIFY(xdgO2ChangedSpy.wait()); | 154 | QVERIFY(xdgO2ChangedSpy.wait()); | ||
155 | QCOMPARE(xdgO2->logicalPosition(), geometries.at(1).topLeft()); | 155 | QCOMPARE(xdgO2->logicalPosition(), geometries.at(1).topLeft()); | ||
156 | QCOMPARE(xdgO2->logicalSize(), geometries.at(1).size()); | 156 | QCOMPARE(xdgO2->logicalSize(), geometries.at(1).size()); | ||
157 | 157 | | |||
158 | // now let's try to remove one output again | 158 | // now let's try to remove one output again | ||
159 | outputAnnouncedSpy.clear(); | 159 | outputAnnouncedSpy.clear(); | ||
160 | outputRemovedSpy.clear(); | 160 | outputRemovedSpy.clear(); | ||
161 | screensChangedSpy.clear(); | 161 | screensChangedSpy.clear(); | ||
162 | 162 | | |||
163 | QSignalSpy o1RemovedSpy(o1.data(), &Output::removed); | 163 | QSignalSpy o1RemovedSpy(o1.data(), &KWayland::Client::Output::removed); | ||
164 | QVERIFY(o1RemovedSpy.isValid()); | 164 | QVERIFY(o1RemovedSpy.isValid()); | ||
165 | QSignalSpy o2RemovedSpy(o2.data(), &Output::removed); | 165 | QSignalSpy o2RemovedSpy(o2.data(), &KWayland::Client::Output::removed); | ||
166 | QVERIFY(o2RemovedSpy.isValid()); | 166 | QVERIFY(o2RemovedSpy.isValid()); | ||
167 | 167 | | |||
168 | const QVector<QRect> geometries2{QRect(0, 0, 1280, 1024)}; | 168 | const QVector<QRect> geometries2{QRect(0, 0, 1280, 1024)}; | ||
169 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", | 169 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", | ||
170 | Qt::DirectConnection, | 170 | Qt::DirectConnection, | ||
171 | Q_ARG(int, 1), | 171 | Q_ARG(int, 1), | ||
172 | Q_ARG(QVector<QRect>, geometries2)); | 172 | Q_ARG(QVector<QRect>, geometries2)); | ||
173 | QVERIFY(screensChangedSpy.wait()); | 173 | QVERIFY(screensChangedSpy.wait()); | ||
Show All 22 Lines |