Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/quick_tiling_test.cpp
Show First 20 Lines • Show All 350 Lines • ▼ Show 20 Line(s) | 336 | { | |||
---|---|---|---|---|---|
351 | QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); | 351 | QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); | ||
352 | QCOMPARE(c->quickTileMode(), QuickTileMode(QuickTileFlag::None)); | 352 | QCOMPARE(c->quickTileMode(), QuickTileMode(QuickTileFlag::None)); | ||
353 | QCOMPARE(c->maximizeMode(), MaximizeRestore); | 353 | QCOMPARE(c->maximizeMode(), MaximizeRestore); | ||
354 | 354 | | |||
355 | QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged); | 355 | QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged); | ||
356 | QVERIFY(quickTileChangedSpy.isValid()); | 356 | QVERIFY(quickTileChangedSpy.isValid()); | ||
357 | 357 | | |||
358 | workspace()->performWindowOperation(c, Options::UnrestrictedMoveOp); | 358 | workspace()->performWindowOperation(c, Options::UnrestrictedMoveOp); | ||
359 | QCOMPARE(c, workspace()->getMovingClient()); | 359 | QCOMPARE(c, workspace()->moveResizeClient()); | ||
360 | QCOMPARE(Cursor::pos(), QPoint(49, 24)); | 360 | QCOMPARE(Cursor::pos(), QPoint(49, 24)); | ||
361 | 361 | | |||
362 | QFETCH(QPoint, targetPos); | 362 | QFETCH(QPoint, targetPos); | ||
363 | quint32 timestamp = 1; | 363 | quint32 timestamp = 1; | ||
364 | kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTCTRL, timestamp++); | 364 | kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTCTRL, timestamp++); | ||
365 | while (Cursor::pos().x() > targetPos.x()) { | 365 | while (Cursor::pos().x() > targetPos.x()) { | ||
366 | kwinApp()->platform()->keyboardKeyPressed(KEY_LEFT, timestamp++); | 366 | kwinApp()->platform()->keyboardKeyPressed(KEY_LEFT, timestamp++); | ||
367 | kwinApp()->platform()->keyboardKeyReleased(KEY_LEFT, timestamp++); | 367 | kwinApp()->platform()->keyboardKeyReleased(KEY_LEFT, timestamp++); | ||
Show All 9 Lines | |||||
377 | while (Cursor::pos().y() > targetPos.y()) { | 377 | while (Cursor::pos().y() > targetPos.y()) { | ||
378 | kwinApp()->platform()->keyboardKeyPressed(KEY_UP, timestamp++); | 378 | kwinApp()->platform()->keyboardKeyPressed(KEY_UP, timestamp++); | ||
379 | kwinApp()->platform()->keyboardKeyReleased(KEY_UP, timestamp++); | 379 | kwinApp()->platform()->keyboardKeyReleased(KEY_UP, timestamp++); | ||
380 | } | 380 | } | ||
381 | kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTCTRL, timestamp++); | 381 | kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTCTRL, timestamp++); | ||
382 | kwinApp()->platform()->keyboardKeyPressed(KEY_ENTER, timestamp++); | 382 | kwinApp()->platform()->keyboardKeyPressed(KEY_ENTER, timestamp++); | ||
383 | kwinApp()->platform()->keyboardKeyReleased(KEY_ENTER, timestamp++); | 383 | kwinApp()->platform()->keyboardKeyReleased(KEY_ENTER, timestamp++); | ||
384 | QCOMPARE(Cursor::pos(), targetPos); | 384 | QCOMPARE(Cursor::pos(), targetPos); | ||
385 | QVERIFY(!workspace()->getMovingClient()); | 385 | QVERIFY(!workspace()->moveResizeClient()); | ||
386 | 386 | | |||
387 | QCOMPARE(quickTileChangedSpy.count(), 1); | 387 | QCOMPARE(quickTileChangedSpy.count(), 1); | ||
388 | QTEST(c->quickTileMode(), "expectedMode"); | 388 | QTEST(c->quickTileMode(), "expectedMode"); | ||
389 | } | 389 | } | ||
390 | 390 | | |||
391 | 391 | | |||
392 | 392 | | |||
393 | void QuickTilingTest::testQuickTilingPointerMove_data() | 393 | void QuickTilingTest::testQuickTilingPointerMove_data() | ||
Show All 28 Lines | 407 | { | |||
422 | QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); | 422 | QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); | ||
423 | QCOMPARE(c->quickTileMode(), QuickTileMode(QuickTileFlag::None)); | 423 | QCOMPARE(c->quickTileMode(), QuickTileMode(QuickTileFlag::None)); | ||
424 | QCOMPARE(c->maximizeMode(), MaximizeRestore); | 424 | QCOMPARE(c->maximizeMode(), MaximizeRestore); | ||
425 | 425 | | |||
426 | QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged); | 426 | QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged); | ||
427 | QVERIFY(quickTileChangedSpy.isValid()); | 427 | QVERIFY(quickTileChangedSpy.isValid()); | ||
428 | 428 | | |||
429 | workspace()->performWindowOperation(c, Options::UnrestrictedMoveOp); | 429 | workspace()->performWindowOperation(c, Options::UnrestrictedMoveOp); | ||
430 | QCOMPARE(c, workspace()->getMovingClient()); | 430 | QCOMPARE(c, workspace()->moveResizeClient()); | ||
431 | QCOMPARE(Cursor::pos(), QPoint(49, 24)); | 431 | QCOMPARE(Cursor::pos(), QPoint(49, 24)); | ||
432 | 432 | | |||
433 | QFETCH(QPoint, targetPos); | 433 | QFETCH(QPoint, targetPos); | ||
434 | quint32 timestamp = 1; | 434 | quint32 timestamp = 1; | ||
435 | kwinApp()->platform()->pointerMotion(targetPos, timestamp++); | 435 | kwinApp()->platform()->pointerMotion(targetPos, timestamp++); | ||
436 | kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); | 436 | kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); | ||
437 | kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++); | 437 | kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++); | ||
438 | QCOMPARE(Cursor::pos(), targetPos); | 438 | QCOMPARE(Cursor::pos(), targetPos); | ||
439 | QVERIFY(!workspace()->getMovingClient()); | 439 | QVERIFY(!workspace()->moveResizeClient()); | ||
440 | 440 | | |||
441 | QCOMPARE(quickTileChangedSpy.count(), 1); | 441 | QCOMPARE(quickTileChangedSpy.count(), 1); | ||
442 | QTEST(c->quickTileMode(), "expectedMode"); | 442 | QTEST(c->quickTileMode(), "expectedMode"); | ||
443 | QTRY_COMPARE(sizeChangeSpy.count(), 1); | 443 | QTRY_COMPARE(sizeChangeSpy.count(), 1); | ||
444 | } | 444 | } | ||
445 | 445 | | |||
446 | 446 | | |||
447 | void QuickTilingTest::testQuickTilingPointerMoveXdgShell_data() | 447 | void QuickTilingTest::testQuickTilingPointerMoveXdgShell_data() | ||
Show All 40 Lines | 461 | { | |||
488 | // we have to receive a configure event when the client becomes active | 488 | // we have to receive a configure event when the client becomes active | ||
489 | QVERIFY(configureRequestedSpy.wait()); | 489 | QVERIFY(configureRequestedSpy.wait()); | ||
490 | QTRY_COMPARE(configureRequestedSpy.count(), 2); | 490 | QTRY_COMPARE(configureRequestedSpy.count(), 2); | ||
491 | 491 | | |||
492 | QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged); | 492 | QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged); | ||
493 | QVERIFY(quickTileChangedSpy.isValid()); | 493 | QVERIFY(quickTileChangedSpy.isValid()); | ||
494 | 494 | | |||
495 | workspace()->performWindowOperation(c, Options::UnrestrictedMoveOp); | 495 | workspace()->performWindowOperation(c, Options::UnrestrictedMoveOp); | ||
496 | QCOMPARE(c, workspace()->getMovingClient()); | 496 | QCOMPARE(c, workspace()->moveResizeClient()); | ||
497 | QCOMPARE(Cursor::pos(), QPoint(49, 24)); | 497 | QCOMPARE(Cursor::pos(), QPoint(49, 24)); | ||
498 | QVERIFY(configureRequestedSpy.wait()); | 498 | QVERIFY(configureRequestedSpy.wait()); | ||
499 | QCOMPARE(configureRequestedSpy.count(), 3); | 499 | QCOMPARE(configureRequestedSpy.count(), 3); | ||
500 | 500 | | |||
501 | QFETCH(QPoint, targetPos); | 501 | QFETCH(QPoint, targetPos); | ||
502 | quint32 timestamp = 1; | 502 | quint32 timestamp = 1; | ||
503 | kwinApp()->platform()->pointerMotion(targetPos, timestamp++); | 503 | kwinApp()->platform()->pointerMotion(targetPos, timestamp++); | ||
504 | kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); | 504 | kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); | ||
505 | kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++); | 505 | kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++); | ||
506 | QCOMPARE(Cursor::pos(), targetPos); | 506 | QCOMPARE(Cursor::pos(), targetPos); | ||
507 | QVERIFY(!workspace()->getMovingClient()); | 507 | QVERIFY(!workspace()->moveResizeClient()); | ||
508 | 508 | | |||
509 | QCOMPARE(quickTileChangedSpy.count(), 1); | 509 | QCOMPARE(quickTileChangedSpy.count(), 1); | ||
510 | QTEST(c->quickTileMode(), "expectedMode"); | 510 | QTEST(c->quickTileMode(), "expectedMode"); | ||
511 | QVERIFY(configureRequestedSpy.wait()); | 511 | QVERIFY(configureRequestedSpy.wait()); | ||
512 | QCOMPARE(configureRequestedSpy.count(), 4); | 512 | QCOMPARE(configureRequestedSpy.count(), 4); | ||
513 | QCOMPARE(false, configureRequestedSpy.last().first().toSize().isEmpty()); | 513 | QCOMPARE(false, configureRequestedSpy.last().first().toSize().isEmpty()); | ||
514 | } | 514 | } | ||
515 | 515 | | |||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | 530 | { | |||
566 | QTRY_COMPARE(configureRequestedSpy.count(), 2); | 566 | QTRY_COMPARE(configureRequestedSpy.count(), 2); | ||
567 | 567 | | |||
568 | QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged); | 568 | QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged); | ||
569 | QVERIFY(quickTileChangedSpy.isValid()); | 569 | QVERIFY(quickTileChangedSpy.isValid()); | ||
570 | 570 | | |||
571 | quint32 timestamp = 1; | 571 | quint32 timestamp = 1; | ||
572 | 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++); | ||
573 | QVERIFY(configureRequestedSpy.wait()); | 573 | QVERIFY(configureRequestedSpy.wait()); | ||
574 | QCOMPARE(c, workspace()->getMovingClient()); | 574 | QCOMPARE(c, workspace()->moveResizeClient()); | ||
575 | QCOMPARE(configureRequestedSpy.count(), 3); | 575 | QCOMPARE(configureRequestedSpy.count(), 3); | ||
576 | 576 | | |||
577 | QFETCH(QPoint, targetPos); | 577 | QFETCH(QPoint, targetPos); | ||
578 | kwinApp()->platform()->touchMotion(0, targetPos, timestamp++); | 578 | kwinApp()->platform()->touchMotion(0, targetPos, timestamp++); | ||
579 | kwinApp()->platform()->touchUp(0, timestamp++); | 579 | kwinApp()->platform()->touchUp(0, timestamp++); | ||
580 | QVERIFY(!workspace()->getMovingClient()); | 580 | QVERIFY(!workspace()->moveResizeClient()); | ||
581 | 581 | | |||
582 | QCOMPARE(quickTileChangedSpy.count(), 1); | 582 | QCOMPARE(quickTileChangedSpy.count(), 1); | ||
583 | QTEST(c->quickTileMode(), "expectedMode"); | 583 | QTEST(c->quickTileMode(), "expectedMode"); | ||
584 | QVERIFY(configureRequestedSpy.wait()); | 584 | QVERIFY(configureRequestedSpy.wait()); | ||
585 | QTRY_COMPARE(configureRequestedSpy.count(), 5); | 585 | QTRY_COMPARE(configureRequestedSpy.count(), 5); | ||
586 | QCOMPARE(false, configureRequestedSpy.last().first().toSize().isEmpty()); | 586 | QCOMPARE(false, configureRequestedSpy.last().first().toSize().isEmpty()); | ||
587 | } | 587 | } | ||
588 | 588 | | |||
▲ Show 20 Lines • Show All 338 Lines • Show Last 20 Lines |