Changeset View
Changeset View
Standalone View
Standalone View
autotests/test_screen_edges.cpp
Show First 20 Lines • Show All 386 Lines • ▼ Show 20 Line(s) | 332 | // QRect(co * 2, sg.height() - co, sg.width() - co * 4, co) | |||
---|---|---|---|---|---|
387 | QCOMPARE(edges.size(), 8); | 387 | QCOMPARE(edges.size(), 8); | ||
388 | for (int i = 0; i < 8; ++i) { | 388 | for (int i = 0; i < 8; ++i) { | ||
389 | auto e = edges.at(i); | 389 | auto e = edges.at(i); | ||
390 | QVERIFY(!e->isReserved()); | 390 | QVERIFY(!e->isReserved()); | ||
391 | QCOMPARE(e->activatesForPointer(), false); | 391 | QCOMPARE(e->activatesForPointer(), false); | ||
392 | QCOMPARE(e->activatesForTouchGesture(), false); | 392 | QCOMPARE(e->activatesForTouchGesture(), false); | ||
393 | QCOMPARE(e->approachGeometry(), expectedGeometries.at(i*2+1)); | 393 | QCOMPARE(e->approachGeometry(), expectedGeometries.at(i*2+1)); | ||
394 | } | 394 | } | ||
395 | | ||||
396 | // let's start a move of window. | ||||
397 | Client client(workspace()); | ||||
398 | workspace()->setMovingClient(&client); | ||||
399 | for (int i = 0; i < 8; ++i) { | ||||
400 | auto e = edges.at(i); | ||||
401 | QVERIFY(!e->isReserved()); | ||||
402 | QCOMPARE(e->activatesForPointer(), true); | ||||
403 | QCOMPARE(e->activatesForTouchGesture(), false); | ||||
404 | QCOMPARE(e->approachGeometry(), expectedGeometries.at(i*2+1)); | ||||
405 | } | ||||
406 | // not for resize | ||||
407 | client.setResize(true); | ||||
408 | for (int i = 0; i < 8; ++i) { | ||||
409 | auto e = edges.at(i); | ||||
410 | QVERIFY(!e->isReserved()); | ||||
411 | QCOMPARE(e->activatesForPointer(), false); | ||||
412 | QCOMPARE(e->activatesForTouchGesture(), false); | ||||
413 | QCOMPARE(e->approachGeometry(), expectedGeometries.at(i*2+1)); | ||||
414 | } | ||||
415 | workspace()->setMovingClient(nullptr); | ||||
395 | } | 416 | } | ||
396 | 417 | | |||
397 | void TestScreenEdges::testCallback() | 418 | void TestScreenEdges::testCallback() | ||
398 | { | 419 | { | ||
399 | using namespace KWin; | 420 | using namespace KWin; | ||
400 | MockWorkspace ws; | 421 | MockWorkspace ws; | ||
401 | static_cast<MockScreens*>(screens())->setGeometries(QList<QRect>{QRect{0, 0, 1024, 768}, QRect{200, 768, 1024, 768}}); | 422 | static_cast<MockScreens*>(screens())->setGeometries(QList<QRect>{QRect{0, 0, 1024, 768}, QRect{200, 768, 1024, 768}}); | ||
402 | QSignalSpy changedSpy(screens(), SIGNAL(changed())); | 423 | QSignalSpy changedSpy(screens(), SIGNAL(changed())); | ||
▲ Show 20 Lines • Show All 649 Lines • Show Last 20 Lines |