Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/internal_window.cpp
Show First 20 Lines • Show All 226 Lines • ▼ Show 20 Line(s) | 219 | { | |||
---|---|---|---|---|---|
227 | 227 | | |||
228 | QTRY_COMPARE(clientAddedSpy.count(), 1); | 228 | QTRY_COMPARE(clientAddedSpy.count(), 1); | ||
229 | QVERIFY(!workspace()->activeClient()); | 229 | QVERIFY(!workspace()->activeClient()); | ||
230 | InternalClient *c = clientAddedSpy.first().first().value<InternalClient *>(); | 230 | InternalClient *c = clientAddedSpy.first().first().value<InternalClient *>(); | ||
231 | QVERIFY(c); | 231 | QVERIFY(c); | ||
232 | QVERIFY(c->isInternal()); | 232 | QVERIFY(c->isInternal()); | ||
233 | QVERIFY(!c->isDecorated()); | 233 | QVERIFY(!c->isDecorated()); | ||
234 | QCOMPARE(workspace()->findInternal(&win), c); | 234 | QCOMPARE(workspace()->findInternal(&win), c); | ||
235 | QCOMPARE(c->geometry(), QRect(0, 0, 100, 100)); | 235 | QCOMPARE(c->frameGeometry(), QRect(0, 0, 100, 100)); | ||
236 | QVERIFY(c->isShown(false)); | 236 | QVERIFY(c->isShown(false)); | ||
237 | QVERIFY(workspace()->xStackingOrder().contains(c)); | 237 | QVERIFY(workspace()->xStackingOrder().contains(c)); | ||
238 | 238 | | |||
239 | QSignalSpy enterSpy(&win, &HelperWindow::entered); | 239 | QSignalSpy enterSpy(&win, &HelperWindow::entered); | ||
240 | QVERIFY(enterSpy.isValid()); | 240 | QVERIFY(enterSpy.isValid()); | ||
241 | QSignalSpy leaveSpy(&win, &HelperWindow::left); | 241 | QSignalSpy leaveSpy(&win, &HelperWindow::left); | ||
242 | QVERIFY(leaveSpy.isValid()); | 242 | QVERIFY(leaveSpy.isValid()); | ||
243 | QSignalSpy moveSpy(&win, &HelperWindow::mouseMoved); | 243 | QSignalSpy moveSpy(&win, &HelperWindow::mouseMoved); | ||
▲ Show 20 Lines • Show All 290 Lines • ▼ Show 20 Line(s) | 532 | { | |||
534 | QVERIFY(clientAddedSpy.isValid()); | 534 | QVERIFY(clientAddedSpy.isValid()); | ||
535 | HelperWindow win; | 535 | HelperWindow win; | ||
536 | win.setOpacity(0.5); | 536 | win.setOpacity(0.5); | ||
537 | win.setGeometry(0, 0, 100, 100); | 537 | win.setGeometry(0, 0, 100, 100); | ||
538 | win.show(); | 538 | win.show(); | ||
539 | QTRY_COMPARE(clientAddedSpy.count(), 1); | 539 | QTRY_COMPARE(clientAddedSpy.count(), 1); | ||
540 | auto internalClient = clientAddedSpy.first().first().value<InternalClient *>(); | 540 | auto internalClient = clientAddedSpy.first().first().value<InternalClient *>(); | ||
541 | QVERIFY(internalClient); | 541 | QVERIFY(internalClient); | ||
542 | QCOMPARE(internalClient->geometry(), QRect(0, 0, 100, 100)); | 542 | QCOMPARE(internalClient->frameGeometry(), QRect(0, 0, 100, 100)); | ||
543 | 543 | | |||
544 | // normal move should be synced | 544 | // normal move should be synced | ||
545 | internalClient->move(5, 10); | 545 | internalClient->move(5, 10); | ||
546 | QCOMPARE(internalClient->geometry(), QRect(5, 10, 100, 100)); | 546 | QCOMPARE(internalClient->frameGeometry(), QRect(5, 10, 100, 100)); | ||
547 | QTRY_COMPARE(win.geometry(), QRect(5, 10, 100, 100)); | 547 | QTRY_COMPARE(win.geometry(), QRect(5, 10, 100, 100)); | ||
548 | // another move should also be synced | 548 | // another move should also be synced | ||
549 | internalClient->move(10, 20); | 549 | internalClient->move(10, 20); | ||
550 | QCOMPARE(internalClient->geometry(), QRect(10, 20, 100, 100)); | 550 | QCOMPARE(internalClient->frameGeometry(), QRect(10, 20, 100, 100)); | ||
551 | QTRY_COMPARE(win.geometry(), QRect(10, 20, 100, 100)); | 551 | QTRY_COMPARE(win.geometry(), QRect(10, 20, 100, 100)); | ||
552 | 552 | | |||
553 | // now move with a Geometry update blocker | 553 | // now move with a Geometry update blocker | ||
554 | { | 554 | { | ||
555 | GeometryUpdatesBlocker blocker(internalClient); | 555 | GeometryUpdatesBlocker blocker(internalClient); | ||
556 | internalClient->move(5, 10); | 556 | internalClient->move(5, 10); | ||
557 | // not synced! | 557 | // not synced! | ||
558 | QCOMPARE(win.geometry(), QRect(10, 20, 100, 100)); | 558 | QCOMPARE(win.geometry(), QRect(10, 20, 100, 100)); | ||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 597 | { | |||
614 | group.sync(); | 614 | group.sync(); | ||
615 | workspace()->slotReconfigure(); | 615 | workspace()->slotReconfigure(); | ||
616 | QCOMPARE(options->commandAllModifier(), Qt::AltModifier); | 616 | QCOMPARE(options->commandAllModifier(), Qt::AltModifier); | ||
617 | QCOMPARE(options->commandAll1(), Options::MouseUnrestrictedMove); | 617 | QCOMPARE(options->commandAll1(), Options::MouseUnrestrictedMove); | ||
618 | QCOMPARE(options->commandAll2(), Options::MouseUnrestrictedMove); | 618 | QCOMPARE(options->commandAll2(), Options::MouseUnrestrictedMove); | ||
619 | QCOMPARE(options->commandAll3(), Options::MouseUnrestrictedMove); | 619 | QCOMPARE(options->commandAll3(), Options::MouseUnrestrictedMove); | ||
620 | 620 | | |||
621 | // move cursor on window | 621 | // move cursor on window | ||
622 | Cursor::setPos(internalClient->geometry().center()); | 622 | Cursor::setPos(internalClient->frameGeometry().center()); | ||
623 | 623 | | |||
624 | // simulate modifier+click | 624 | // simulate modifier+click | ||
625 | quint32 timestamp = 1; | 625 | quint32 timestamp = 1; | ||
626 | kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTALT, timestamp++); | 626 | kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTALT, timestamp++); | ||
627 | QVERIFY(!internalClient->isMove()); | 627 | QVERIFY(!internalClient->isMove()); | ||
628 | kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); | 628 | kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); | ||
629 | QVERIFY(internalClient->isMove()); | 629 | QVERIFY(internalClient->isMove()); | ||
630 | // release modifier should not change it | 630 | // release modifier should not change it | ||
Show All 19 Lines | 639 | { | |||
650 | 650 | | |||
651 | KConfigGroup group = kwinApp()->config()->group("MouseBindings"); | 651 | KConfigGroup group = kwinApp()->config()->group("MouseBindings"); | ||
652 | group.writeEntry("CommandAllKey", "Alt"); | 652 | group.writeEntry("CommandAllKey", "Alt"); | ||
653 | group.writeEntry("CommandAllWheel", "change opacity"); | 653 | group.writeEntry("CommandAllWheel", "change opacity"); | ||
654 | group.sync(); | 654 | group.sync(); | ||
655 | workspace()->slotReconfigure(); | 655 | workspace()->slotReconfigure(); | ||
656 | 656 | | |||
657 | // move cursor on window | 657 | // move cursor on window | ||
658 | Cursor::setPos(internalClient->geometry().center()); | 658 | Cursor::setPos(internalClient->frameGeometry().center()); | ||
659 | 659 | | |||
660 | // set the opacity to 0.5 | 660 | // set the opacity to 0.5 | ||
661 | internalClient->setOpacity(0.5); | 661 | internalClient->setOpacity(0.5); | ||
662 | QCOMPARE(internalClient->opacity(), 0.5); | 662 | QCOMPARE(internalClient->opacity(), 0.5); | ||
663 | quint32 timestamp = 1; | 663 | quint32 timestamp = 1; | ||
664 | kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTALT, timestamp++); | 664 | kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTALT, timestamp++); | ||
665 | kwinApp()->platform()->pointerAxisVertical(-5, timestamp++); | 665 | kwinApp()->platform()->pointerAxisVertical(-5, timestamp++); | ||
666 | QCOMPARE(internalClient->opacity(), 0.6); | 666 | QCOMPARE(internalClient->opacity(), 0.6); | ||
▲ Show 20 Lines • Show All 135 Lines • Show Last 20 Lines |