Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/quick_tiling_test.cpp
Show First 20 Lines • Show All 458 Lines • ▼ Show 20 Line(s) | |||||
459 | 459 | | |||
460 | void QuickTilingTest::testQuickTilingPointerMoveXdgShell() | 460 | void QuickTilingTest::testQuickTilingPointerMoveXdgShell() | ||
461 | { | 461 | { | ||
462 | using namespace KWayland::Client; | 462 | using namespace KWayland::Client; | ||
463 | 463 | | |||
464 | QScopedPointer<Surface> surface(Test::createSurface()); | 464 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
465 | QVERIFY(!surface.isNull()); | 465 | QVERIFY(!surface.isNull()); | ||
466 | 466 | | |||
467 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellV6Surface(surface.data())); | 467 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellV6Surface( | ||
468 | surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | ||||
468 | QVERIFY(!shellSurface.isNull()); | 469 | QVERIFY(!shellSurface.isNull()); | ||
470 | | ||||
471 | // wait for the initial configure event | ||||
469 | QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); | 472 | QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); | ||
470 | QVERIFY(configureRequestedSpy.isValid()); | 473 | QVERIFY(configureRequestedSpy.isValid()); | ||
474 | surface->commit(Surface::CommitFlag::None); | ||||
zzag: We don't want frame callback, sorry for this mistake. | |||||
475 | QVERIFY(configureRequestedSpy.wait()); | ||||
476 | QCOMPARE(configureRequestedSpy.count(), 1); | ||||
477 | | ||||
471 | // let's render | 478 | // let's render | ||
479 | shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>()); | ||||
472 | auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | 480 | auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | ||
473 | 481 | | |||
474 | QVERIFY(c); | 482 | QVERIFY(c); | ||
475 | QCOMPARE(workspace()->activeClient(), c); | 483 | QCOMPARE(workspace()->activeClient(), c); | ||
476 | QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); | 484 | QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); | ||
477 | QCOMPARE(c->quickTileMode(), QuickTileMode(QuickTileFlag::None)); | 485 | QCOMPARE(c->quickTileMode(), QuickTileMode(QuickTileFlag::None)); | ||
478 | QCOMPARE(c->maximizeMode(), MaximizeRestore); | 486 | QCOMPARE(c->maximizeMode(), MaximizeRestore); | ||
487 | | ||||
488 | // we have to receive a configure event when the client becomes active | ||||
479 | QVERIFY(configureRequestedSpy.wait()); | 489 | QVERIFY(configureRequestedSpy.wait()); | ||
480 | QTRY_COMPARE(configureRequestedSpy.count(), 2); | 490 | QTRY_COMPARE(configureRequestedSpy.count(), 2); | ||
481 | 491 | | |||
482 | QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged); | 492 | QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged); | ||
483 | QVERIFY(quickTileChangedSpy.isValid()); | 493 | QVERIFY(quickTileChangedSpy.isValid()); | ||
484 | 494 | | |||
485 | workspace()->performWindowOperation(c, Options::UnrestrictedMoveOp); | 495 | workspace()->performWindowOperation(c, Options::UnrestrictedMoveOp); | ||
486 | QCOMPARE(c, workspace()->getMovingClient()); | 496 | QCOMPARE(c, workspace()->getMovingClient()); | ||
Show All 34 Lines | 530 | { | |||
521 | // test verifies that touch on decoration also allows quick tiling | 531 | // test verifies that touch on decoration also allows quick tiling | ||
522 | // see BUG: 390113 | 532 | // see BUG: 390113 | ||
523 | using namespace KWayland::Client; | 533 | using namespace KWayland::Client; | ||
524 | 534 | | |||
525 | QScopedPointer<Surface> surface(Test::createSurface()); | 535 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
526 | QVERIFY(!surface.isNull()); | 536 | QVERIFY(!surface.isNull()); | ||
527 | QScopedPointer<ServerSideDecoration> deco(Test::waylandServerSideDecoration()->create(surface.data())); | 537 | QScopedPointer<ServerSideDecoration> deco(Test::waylandServerSideDecoration()->create(surface.data())); | ||
528 | 538 | | |||
529 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellV6Surface(surface.data())); | 539 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellV6Surface( | ||
540 | surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); | ||||
530 | QVERIFY(!shellSurface.isNull()); | 541 | QVERIFY(!shellSurface.isNull()); | ||
542 | | ||||
543 | // wait for the initial configure event | ||||
531 | QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); | 544 | QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested); | ||
532 | QVERIFY(configureRequestedSpy.isValid()); | 545 | QVERIFY(configureRequestedSpy.isValid()); | ||
546 | surface->commit(Surface::CommitFlag::None); | ||||
547 | QVERIFY(configureRequestedSpy.wait()); | ||||
548 | QCOMPARE(configureRequestedSpy.count(), 1); | ||||
549 | | ||||
533 | // let's render | 550 | // let's render | ||
551 | shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>()); | ||||
534 | auto c = Test::renderAndWaitForShown(surface.data(), QSize(1000, 50), Qt::blue); | 552 | auto c = Test::renderAndWaitForShown(surface.data(), QSize(1000, 50), Qt::blue); | ||
535 | 553 | | |||
536 | QVERIFY(c); | 554 | QVERIFY(c); | ||
537 | QVERIFY(c->isDecorated()); | 555 | QVERIFY(c->isDecorated()); | ||
538 | const auto decoration = c->decoration(); | 556 | const auto decoration = c->decoration(); | ||
539 | QCOMPARE(workspace()->activeClient(), c); | 557 | QCOMPARE(workspace()->activeClient(), c); | ||
540 | QCOMPARE(c->geometry(), QRect(-decoration->borderLeft(), 0, | 558 | QCOMPARE(c->geometry(), QRect(-decoration->borderLeft(), 0, | ||
541 | 1000 + decoration->borderLeft() + decoration->borderRight(), | 559 | 1000 + decoration->borderLeft() + decoration->borderRight(), | ||
542 | 50 + decoration->borderTop() + decoration->borderBottom())); | 560 | 50 + decoration->borderTop() + decoration->borderBottom())); | ||
543 | QCOMPARE(c->quickTileMode(), QuickTileMode(QuickTileFlag::None)); | 561 | QCOMPARE(c->quickTileMode(), QuickTileMode(QuickTileFlag::None)); | ||
544 | QCOMPARE(c->maximizeMode(), MaximizeRestore); | 562 | QCOMPARE(c->maximizeMode(), MaximizeRestore); | ||
563 | | ||||
564 | // we have to receive a configure event when the client becomes active | ||||
545 | QVERIFY(configureRequestedSpy.wait()); | 565 | QVERIFY(configureRequestedSpy.wait()); | ||
546 | QTRY_COMPARE(configureRequestedSpy.count(), 2); | 566 | QTRY_COMPARE(configureRequestedSpy.count(), 2); | ||
547 | 567 | | |||
548 | QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged); | 568 | QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged); | ||
549 | QVERIFY(quickTileChangedSpy.isValid()); | 569 | QVERIFY(quickTileChangedSpy.isValid()); | ||
550 | 570 | | |||
551 | quint32 timestamp = 1; | 571 | quint32 timestamp = 1; | ||
552 | kwinApp()->platform()->touchDown(0, QPointF(c->geometry().center().x(), c->geometry().y() + decoration->borderTop() / 2), timestamp++); | 572 | kwinApp()->platform()->touchDown(0, QPointF(c->geometry().center().x(), c->geometry().y() + decoration->borderTop() / 2), timestamp++); | ||
▲ Show 20 Lines • Show All 354 Lines • Show Last 20 Lines |
We don't want frame callback, sorry for this mistake.