Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/pointer_constraints_test.cpp
Show First 20 Lines • Show All 334 Lines • ▼ Show 20 Line(s) | 309 | { | |||
---|---|---|---|---|---|
335 | KWin::Cursor::setPos(c->geometry().center()); | 335 | KWin::Cursor::setPos(c->geometry().center()); | ||
336 | QCOMPARE(KWin::Cursor::pos(), c->geometry().center()); | 336 | QCOMPARE(KWin::Cursor::pos(), c->geometry().center()); | ||
337 | QCOMPARE(input()->pointer()->isConstrained(), true); | 337 | QCOMPARE(input()->pointer()->isConstrained(), true); | ||
338 | QVERIFY(lockedSpy.wait()); | 338 | QVERIFY(lockedSpy.wait()); | ||
339 | 339 | | |||
340 | // now try to break | 340 | // now try to break | ||
341 | quint32 timestamp = 0; | 341 | quint32 timestamp = 0; | ||
342 | kwinApp()->platform()->keyboardKeyPressed(KEY_ESC, timestamp++); | 342 | kwinApp()->platform()->keyboardKeyPressed(KEY_ESC, timestamp++); | ||
343 | QVERIFY(keyboardLeftSpy.wait()); | | |||
344 | // and just waiting should break constrain | 343 | // and just waiting should break constrain | ||
345 | QVERIFY(unlockedSpy.wait()); | 344 | QVERIFY(unlockedSpy.wait()); | ||
345 | QCOMPARE(keyboardLeftSpy.count(), 1); | ||||
346 | QCOMPARE(input()->pointer()->isConstrained(), false); | 346 | QCOMPARE(input()->pointer()->isConstrained(), false); | ||
347 | // and should enter again | 347 | // and should enter again | ||
348 | QTRY_COMPARE(keyboardEnteredSpy.count(), 2); | 348 | QTRY_COMPARE(keyboardEnteredSpy.count(), 2); | ||
349 | QCOMPARE(waylandServer()->seat()->focusedKeyboardSurface(), c->surface()); | 349 | QCOMPARE(waylandServer()->seat()->focusedKeyboardSurface(), c->surface()); | ||
350 | kwinApp()->platform()->keyboardKeyReleased(KEY_ESC, timestamp++); | 350 | kwinApp()->platform()->keyboardKeyReleased(KEY_ESC, timestamp++); | ||
351 | QVERIFY(!keyChangedSpy.wait()); | 351 | QVERIFY(!keyChangedSpy.wait()); | ||
352 | QVERIFY(keyChangedSpy.isEmpty()); | 352 | QVERIFY(keyChangedSpy.isEmpty()); | ||
353 | 353 | | |||
Show All 35 Lines |