Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/pointer_constraints_test.cpp
Show First 20 Lines • Show All 218 Lines • ▼ Show 20 Line(s) | 140 | { | |||
---|---|---|---|---|---|
219 | QVERIFY(!confinedSpy2.wait()); | 219 | QVERIFY(!confinedSpy2.wait()); | ||
220 | 220 | | |||
221 | // now move outside and back in again, that should confine | 221 | // now move outside and back in again, that should confine | ||
222 | KWin::Cursor::setPos(c->geometry().bottomRight() + QPoint(1, 1)); | 222 | KWin::Cursor::setPos(c->geometry().bottomRight() + QPoint(1, 1)); | ||
223 | KWin::Cursor::setPos(c->geometry().center() + QPoint(1, 1)); | 223 | KWin::Cursor::setPos(c->geometry().center() + QPoint(1, 1)); | ||
224 | QCOMPARE(input()->pointer()->isConstrained(), true); | 224 | QCOMPARE(input()->pointer()->isConstrained(), true); | ||
225 | QVERIFY(confinedSpy2.wait()); | 225 | QVERIFY(confinedSpy2.wait()); | ||
226 | 226 | | |||
227 | // deactivate the client, this should unconfine | ||||
228 | workspace()->activateClient(nullptr); | ||||
229 | QVERIFY(unconfinedSpy2.wait()); | ||||
230 | QCOMPARE(input()->pointer()->isConstrained(), false); | ||||
231 | | ||||
232 | // activate it again, this confines again | ||||
233 | workspace()->activateClient(static_cast<AbstractClient*>(input()->pointer()->window().data())); | ||||
234 | QVERIFY(confinedSpy2.wait()); | ||||
235 | QCOMPARE(input()->pointer()->isConstrained(), true); | ||||
236 | | ||||
227 | // create a second window and move it above our constrained window | 237 | // create a second window and move it above our constrained window | ||
228 | QScopedPointer<Surface> surface2(Test::createSurface()); | 238 | QScopedPointer<Surface> surface2(Test::createSurface()); | ||
229 | QScopedPointer<QObject> shellSurface2(Test::createShellSurface(type, surface2.data())); | 239 | QScopedPointer<QObject> shellSurface2(Test::createShellSurface(type, surface2.data())); | ||
230 | auto c2 = Test::renderAndWaitForShown(surface2.data(), QSize(1280, 1024), Qt::blue); | 240 | auto c2 = Test::renderAndWaitForShown(surface2.data(), QSize(1280, 1024), Qt::blue); | ||
231 | QVERIFY(c2); | 241 | QVERIFY(c2); | ||
232 | QVERIFY(unconfinedSpy2.wait()); | 242 | QVERIFY(unconfinedSpy2.wait()); | ||
233 | // and unmapping the second window should confine again | 243 | // and unmapping the second window should confine again | ||
234 | shellSurface2.reset(); | 244 | shellSurface2.reset(); | ||
▲ Show 20 Lines • Show All 247 Lines • Show Last 20 Lines |