Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/pointer_input.cpp
Show First 20 Lines • Show All 299 Lines • ▼ Show 20 Line(s) | 280 | { | |||
---|---|---|---|---|---|
300 | XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface); | 300 | XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface); | ||
301 | QVERIFY(shellSurface); | 301 | QVERIFY(shellSurface); | ||
302 | render(surface); | 302 | render(surface); | ||
303 | QVERIFY(clientAddedSpy.wait()); | 303 | QVERIFY(clientAddedSpy.wait()); | ||
304 | AbstractClient *window = workspace()->activeClient(); | 304 | AbstractClient *window = workspace()->activeClient(); | ||
305 | QVERIFY(window); | 305 | QVERIFY(window); | ||
306 | 306 | | |||
307 | QCOMPARE(window->pos(), QPoint(0, 0)); | 307 | QCOMPARE(window->pos(), QPoint(0, 0)); | ||
308 | QVERIFY(window->geometry().contains(Cursor::pos())); | 308 | QVERIFY(window->frameGeometry().contains(Cursor::pos())); | ||
309 | 309 | | |||
310 | // is PresentWindows effect for top left screen edge loaded | 310 | // is PresentWindows effect for top left screen edge loaded | ||
311 | QVERIFY(static_cast<EffectsHandlerImpl*>(effects)->isEffectLoaded("presentwindows")); | 311 | QVERIFY(static_cast<EffectsHandlerImpl*>(effects)->isEffectLoaded("presentwindows")); | ||
312 | QVERIFY(movedSpy.isEmpty()); | 312 | QVERIFY(movedSpy.isEmpty()); | ||
313 | quint32 timestamp = 0; | 313 | quint32 timestamp = 0; | ||
314 | kwinApp()->platform()->pointerMotion(QPoint(0, 0), timestamp++); | 314 | kwinApp()->platform()->pointerMotion(QPoint(0, 0), timestamp++); | ||
315 | // screen edges push back | 315 | // screen edges push back | ||
316 | QCOMPARE(Cursor::pos(), QPoint(1, 1)); | 316 | QCOMPARE(Cursor::pos(), QPoint(1, 1)); | ||
Show All 24 Lines | 324 | { | |||
341 | Surface *surface = Test::createSurface(m_compositor); | 341 | Surface *surface = Test::createSurface(m_compositor); | ||
342 | QVERIFY(surface); | 342 | QVERIFY(surface); | ||
343 | XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface); | 343 | XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface); | ||
344 | QVERIFY(shellSurface); | 344 | QVERIFY(shellSurface); | ||
345 | render(surface, QSize(1280, 1024)); | 345 | render(surface, QSize(1280, 1024)); | ||
346 | QVERIFY(clientAddedSpy.wait()); | 346 | QVERIFY(clientAddedSpy.wait()); | ||
347 | AbstractClient *window = workspace()->activeClient(); | 347 | AbstractClient *window = workspace()->activeClient(); | ||
348 | QVERIFY(window); | 348 | QVERIFY(window); | ||
349 | QVERIFY(!window->geometry().contains(Cursor::pos())); | 349 | QVERIFY(!window->frameGeometry().contains(Cursor::pos())); | ||
350 | 350 | | |||
351 | QSignalSpy screensChangedSpy(screens(), &Screens::changed); | 351 | QSignalSpy screensChangedSpy(screens(), &Screens::changed); | ||
352 | QVERIFY(screensChangedSpy.isValid()); | 352 | QVERIFY(screensChangedSpy.isValid()); | ||
353 | // now let's remove the screen containing the cursor | 353 | // now let's remove the screen containing the cursor | ||
354 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", | 354 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", | ||
355 | Qt::DirectConnection, | 355 | Qt::DirectConnection, | ||
356 | Q_ARG(int, 1), | 356 | Q_ARG(int, 1), | ||
357 | Q_ARG(QVector<QRect>, QVector<QRect>{QRect(0, 0, 1280, 1024)})); | 357 | Q_ARG(QVector<QRect>, QVector<QRect>{QRect(0, 0, 1280, 1024)})); | ||
358 | QVERIFY(screensChangedSpy.wait()); | 358 | QVERIFY(screensChangedSpy.wait()); | ||
359 | QCOMPARE(screens()->count(), 1); | 359 | QCOMPARE(screens()->count(), 1); | ||
360 | 360 | | |||
361 | // this should have warped the cursor | 361 | // this should have warped the cursor | ||
362 | QCOMPARE(Cursor::pos(), QPoint(639, 511)); | 362 | QCOMPARE(Cursor::pos(), QPoint(639, 511)); | ||
363 | QVERIFY(window->geometry().contains(Cursor::pos())); | 363 | QVERIFY(window->frameGeometry().contains(Cursor::pos())); | ||
364 | 364 | | |||
365 | // and we should get an enter event | 365 | // and we should get an enter event | ||
366 | QTRY_COMPARE(enteredSpy.count(), 1); | 366 | QTRY_COMPARE(enteredSpy.count(), 1); | ||
367 | } | 367 | } | ||
368 | 368 | | |||
369 | void PointerInputTest::testModifierClickUnrestrictedMove_data() | 369 | void PointerInputTest::testModifierClickUnrestrictedMove_data() | ||
370 | { | 370 | { | ||
371 | QTest::addColumn<int>("modifierKey"); | 371 | QTest::addColumn<int>("modifierKey"); | ||
▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Line(s) | 410 | { | |||
439 | XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface); | 439 | XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface); | ||
440 | QVERIFY(shellSurface); | 440 | QVERIFY(shellSurface); | ||
441 | render(surface); | 441 | render(surface); | ||
442 | QVERIFY(clientAddedSpy.wait()); | 442 | QVERIFY(clientAddedSpy.wait()); | ||
443 | AbstractClient *window = workspace()->activeClient(); | 443 | AbstractClient *window = workspace()->activeClient(); | ||
444 | QVERIFY(window); | 444 | QVERIFY(window); | ||
445 | 445 | | |||
446 | // move cursor on window | 446 | // move cursor on window | ||
447 | Cursor::setPos(window->geometry().center()); | 447 | Cursor::setPos(window->frameGeometry().center()); | ||
448 | 448 | | |||
449 | // simulate modifier+click | 449 | // simulate modifier+click | ||
450 | quint32 timestamp = 1; | 450 | quint32 timestamp = 1; | ||
451 | QFETCH(bool, capsLock); | 451 | QFETCH(bool, capsLock); | ||
452 | if (capsLock) { | 452 | if (capsLock) { | ||
453 | kwinApp()->platform()->keyboardKeyPressed(KEY_CAPSLOCK, timestamp++); | 453 | kwinApp()->platform()->keyboardKeyPressed(KEY_CAPSLOCK, timestamp++); | ||
454 | } | 454 | } | ||
455 | QFETCH(int, modifierKey); | 455 | QFETCH(int, modifierKey); | ||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 478 | { | |||
511 | QVERIFY(window); | 511 | QVERIFY(window); | ||
512 | 512 | | |||
513 | // disable global shortcuts | 513 | // disable global shortcuts | ||
514 | QVERIFY(!workspace()->globalShortcutsDisabled()); | 514 | QVERIFY(!workspace()->globalShortcutsDisabled()); | ||
515 | workspace()->disableGlobalShortcutsForClient(true); | 515 | workspace()->disableGlobalShortcutsForClient(true); | ||
516 | QVERIFY(workspace()->globalShortcutsDisabled()); | 516 | QVERIFY(workspace()->globalShortcutsDisabled()); | ||
517 | 517 | | |||
518 | // move cursor on window | 518 | // move cursor on window | ||
519 | Cursor::setPos(window->geometry().center()); | 519 | Cursor::setPos(window->frameGeometry().center()); | ||
520 | 520 | | |||
521 | // simulate modifier+click | 521 | // simulate modifier+click | ||
522 | quint32 timestamp = 1; | 522 | quint32 timestamp = 1; | ||
523 | kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTALT, timestamp++); | 523 | kwinApp()->platform()->keyboardKeyPressed(KEY_LEFTALT, timestamp++); | ||
524 | QVERIFY(!window->isMove()); | 524 | QVERIFY(!window->isMove()); | ||
525 | kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); | 525 | kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); | ||
526 | QVERIFY(!window->isMove()); | 526 | QVERIFY(!window->isMove()); | ||
527 | // release modifier should not change it | 527 | // release modifier should not change it | ||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | 555 | { | |||
582 | QVERIFY(clientAddedSpy.wait()); | 582 | QVERIFY(clientAddedSpy.wait()); | ||
583 | AbstractClient *window = workspace()->activeClient(); | 583 | AbstractClient *window = workspace()->activeClient(); | ||
584 | QVERIFY(window); | 584 | QVERIFY(window); | ||
585 | // set the opacity to 0.5 | 585 | // set the opacity to 0.5 | ||
586 | window->setOpacity(0.5); | 586 | window->setOpacity(0.5); | ||
587 | QCOMPARE(window->opacity(), 0.5); | 587 | QCOMPARE(window->opacity(), 0.5); | ||
588 | 588 | | |||
589 | // move cursor on window | 589 | // move cursor on window | ||
590 | Cursor::setPos(window->geometry().center()); | 590 | Cursor::setPos(window->frameGeometry().center()); | ||
591 | 591 | | |||
592 | // simulate modifier+wheel | 592 | // simulate modifier+wheel | ||
593 | quint32 timestamp = 1; | 593 | quint32 timestamp = 1; | ||
594 | QFETCH(bool, capsLock); | 594 | QFETCH(bool, capsLock); | ||
595 | if (capsLock) { | 595 | if (capsLock) { | ||
596 | kwinApp()->platform()->keyboardKeyPressed(KEY_CAPSLOCK, timestamp++); | 596 | kwinApp()->platform()->keyboardKeyPressed(KEY_CAPSLOCK, timestamp++); | ||
597 | } | 597 | } | ||
598 | QFETCH(int, modifierKey); | 598 | QFETCH(int, modifierKey); | ||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 615 | { | |||
641 | QVERIFY(clientAddedSpy.wait()); | 641 | QVERIFY(clientAddedSpy.wait()); | ||
642 | AbstractClient *window = workspace()->activeClient(); | 642 | AbstractClient *window = workspace()->activeClient(); | ||
643 | QVERIFY(window); | 643 | QVERIFY(window); | ||
644 | // set the opacity to 0.5 | 644 | // set the opacity to 0.5 | ||
645 | window->setOpacity(0.5); | 645 | window->setOpacity(0.5); | ||
646 | QCOMPARE(window->opacity(), 0.5); | 646 | QCOMPARE(window->opacity(), 0.5); | ||
647 | 647 | | |||
648 | // move cursor on window | 648 | // move cursor on window | ||
649 | Cursor::setPos(window->geometry().center()); | 649 | Cursor::setPos(window->frameGeometry().center()); | ||
650 | 650 | | |||
651 | // disable global shortcuts | 651 | // disable global shortcuts | ||
652 | QVERIFY(!workspace()->globalShortcutsDisabled()); | 652 | QVERIFY(!workspace()->globalShortcutsDisabled()); | ||
653 | workspace()->disableGlobalShortcutsForClient(true); | 653 | workspace()->disableGlobalShortcutsForClient(true); | ||
654 | QVERIFY(workspace()->globalShortcutsDisabled()); | 654 | QVERIFY(workspace()->globalShortcutsDisabled()); | ||
655 | 655 | | |||
656 | // simulate modifier+wheel | 656 | // simulate modifier+wheel | ||
657 | quint32 timestamp = 1; | 657 | quint32 timestamp = 1; | ||
Show All 39 Lines | 669 | { | |||
697 | QVERIFY(shellSurface2); | 697 | QVERIFY(shellSurface2); | ||
698 | render(surface2); | 698 | render(surface2); | ||
699 | QVERIFY(clientAddedSpy.wait()); | 699 | QVERIFY(clientAddedSpy.wait()); | ||
700 | AbstractClient *window2 = workspace()->activeClient(); | 700 | AbstractClient *window2 = workspace()->activeClient(); | ||
701 | QVERIFY(window2); | 701 | QVERIFY(window2); | ||
702 | QVERIFY(window1 != window2); | 702 | QVERIFY(window1 != window2); | ||
703 | 703 | | |||
704 | // move cursor to the inactive window | 704 | // move cursor to the inactive window | ||
705 | Cursor::setPos(window1->geometry().center()); | 705 | Cursor::setPos(window1->frameGeometry().center()); | ||
706 | 706 | | |||
707 | quint32 timestamp = 1; | 707 | quint32 timestamp = 1; | ||
708 | QVERIFY(!window1->isActive()); | 708 | QVERIFY(!window1->isActive()); | ||
709 | kwinApp()->platform()->pointerAxisVertical(5, timestamp++); | 709 | kwinApp()->platform()->pointerAxisVertical(5, timestamp++); | ||
710 | QVERIFY(window1->isActive()); | 710 | QVERIFY(window1->isActive()); | ||
711 | 711 | | |||
712 | // but also the wheel event should be passed to the window | 712 | // but also the wheel event should be passed to the window | ||
713 | QVERIFY(axisSpy.wait()); | 713 | QVERIFY(axisSpy.wait()); | ||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | 720 | { | |||
757 | QVERIFY(shellSurface2); | 757 | QVERIFY(shellSurface2); | ||
758 | render(surface2, QSize(800, 800)); | 758 | render(surface2, QSize(800, 800)); | ||
759 | QVERIFY(clientAddedSpy.wait()); | 759 | QVERIFY(clientAddedSpy.wait()); | ||
760 | AbstractClient *window2 = workspace()->activeClient(); | 760 | AbstractClient *window2 = workspace()->activeClient(); | ||
761 | QVERIFY(window2); | 761 | QVERIFY(window2); | ||
762 | QVERIFY(window1 != window2); | 762 | QVERIFY(window1 != window2); | ||
763 | QCOMPARE(workspace()->topClientOnDesktop(1, -1), window2); | 763 | QCOMPARE(workspace()->topClientOnDesktop(1, -1), window2); | ||
764 | // geometry of the two windows should be overlapping | 764 | // geometry of the two windows should be overlapping | ||
765 | QVERIFY(window1->geometry().intersects(window2->geometry())); | 765 | QVERIFY(window1->frameGeometry().intersects(window2->frameGeometry())); | ||
766 | 766 | | |||
767 | // signal spies for active window changed and stacking order changed | 767 | // signal spies for active window changed and stacking order changed | ||
768 | QSignalSpy activeWindowChangedSpy(workspace(), &Workspace::clientActivated); | 768 | QSignalSpy activeWindowChangedSpy(workspace(), &Workspace::clientActivated); | ||
769 | QVERIFY(activeWindowChangedSpy.isValid()); | 769 | QVERIFY(activeWindowChangedSpy.isValid()); | ||
770 | QSignalSpy stackingOrderChangedSpy(workspace(), &Workspace::stackingOrderChanged); | 770 | QSignalSpy stackingOrderChangedSpy(workspace(), &Workspace::stackingOrderChanged); | ||
771 | QVERIFY(stackingOrderChangedSpy.isValid()); | 771 | QVERIFY(stackingOrderChangedSpy.isValid()); | ||
772 | 772 | | |||
773 | QVERIFY(!window1->isActive()); | 773 | QVERIFY(!window1->isActive()); | ||
774 | QVERIFY(window2->isActive()); | 774 | QVERIFY(window2->isActive()); | ||
775 | 775 | | |||
776 | // move on top of first window | 776 | // move on top of first window | ||
777 | QVERIFY(window1->geometry().contains(10, 10)); | 777 | QVERIFY(window1->frameGeometry().contains(10, 10)); | ||
778 | QVERIFY(!window2->geometry().contains(10, 10)); | 778 | QVERIFY(!window2->frameGeometry().contains(10, 10)); | ||
779 | Cursor::setPos(10, 10); | 779 | Cursor::setPos(10, 10); | ||
780 | QVERIFY(stackingOrderChangedSpy.wait()); | 780 | QVERIFY(stackingOrderChangedSpy.wait()); | ||
781 | QCOMPARE(stackingOrderChangedSpy.count(), 1); | 781 | QCOMPARE(stackingOrderChangedSpy.count(), 1); | ||
782 | QCOMPARE(workspace()->topClientOnDesktop(1, -1), window1); | 782 | QCOMPARE(workspace()->topClientOnDesktop(1, -1), window1); | ||
783 | QTRY_VERIFY(window1->isActive()); | 783 | QTRY_VERIFY(window1->isActive()); | ||
784 | 784 | | |||
785 | // move on second window, but move away before active window change delay hits | 785 | // move on second window, but move away before active window change delay hits | ||
786 | Cursor::setPos(810, 810); | 786 | Cursor::setPos(810, 810); | ||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | 813 | { | |||
843 | QVERIFY(shellSurface2); | 843 | QVERIFY(shellSurface2); | ||
844 | render(surface2, QSize(800, 800)); | 844 | render(surface2, QSize(800, 800)); | ||
845 | QVERIFY(clientAddedSpy.wait()); | 845 | QVERIFY(clientAddedSpy.wait()); | ||
846 | AbstractClient *window2 = workspace()->activeClient(); | 846 | AbstractClient *window2 = workspace()->activeClient(); | ||
847 | QVERIFY(window2); | 847 | QVERIFY(window2); | ||
848 | QVERIFY(window1 != window2); | 848 | QVERIFY(window1 != window2); | ||
849 | QCOMPARE(workspace()->topClientOnDesktop(1, -1), window2); | 849 | QCOMPARE(workspace()->topClientOnDesktop(1, -1), window2); | ||
850 | // geometry of the two windows should be overlapping | 850 | // geometry of the two windows should be overlapping | ||
851 | QVERIFY(window1->geometry().intersects(window2->geometry())); | 851 | QVERIFY(window1->frameGeometry().intersects(window2->frameGeometry())); | ||
852 | 852 | | |||
853 | // signal spies for active window changed and stacking order changed | 853 | // signal spies for active window changed and stacking order changed | ||
854 | QSignalSpy activeWindowChangedSpy(workspace(), &Workspace::clientActivated); | 854 | QSignalSpy activeWindowChangedSpy(workspace(), &Workspace::clientActivated); | ||
855 | QVERIFY(activeWindowChangedSpy.isValid()); | 855 | QVERIFY(activeWindowChangedSpy.isValid()); | ||
856 | QSignalSpy stackingOrderChangedSpy(workspace(), &Workspace::stackingOrderChanged); | 856 | QSignalSpy stackingOrderChangedSpy(workspace(), &Workspace::stackingOrderChanged); | ||
857 | QVERIFY(stackingOrderChangedSpy.isValid()); | 857 | QVERIFY(stackingOrderChangedSpy.isValid()); | ||
858 | 858 | | |||
859 | QVERIFY(!window1->isActive()); | 859 | QVERIFY(!window1->isActive()); | ||
860 | QVERIFY(window2->isActive()); | 860 | QVERIFY(window2->isActive()); | ||
861 | 861 | | |||
862 | // move on top of first window | 862 | // move on top of first window | ||
863 | QVERIFY(window1->geometry().contains(10, 10)); | 863 | QVERIFY(window1->frameGeometry().contains(10, 10)); | ||
864 | QVERIFY(!window2->geometry().contains(10, 10)); | 864 | QVERIFY(!window2->frameGeometry().contains(10, 10)); | ||
865 | Cursor::setPos(10, 10); | 865 | Cursor::setPos(10, 10); | ||
866 | // no focus follows mouse | 866 | // no focus follows mouse | ||
867 | QVERIFY(!stackingOrderChangedSpy.wait(200)); | 867 | QVERIFY(!stackingOrderChangedSpy.wait(200)); | ||
868 | QVERIFY(stackingOrderChangedSpy.isEmpty()); | 868 | QVERIFY(stackingOrderChangedSpy.isEmpty()); | ||
869 | QVERIFY(activeWindowChangedSpy.isEmpty()); | 869 | QVERIFY(activeWindowChangedSpy.isEmpty()); | ||
870 | QVERIFY(window2->isActive()); | 870 | QVERIFY(window2->isActive()); | ||
871 | // and click | 871 | // and click | ||
872 | quint32 timestamp = 1; | 872 | quint32 timestamp = 1; | ||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | 899 | { | |||
937 | QVERIFY(clientAddedSpy.wait()); | 937 | QVERIFY(clientAddedSpy.wait()); | ||
938 | AbstractClient *window2 = workspace()->activeClient(); | 938 | AbstractClient *window2 = workspace()->activeClient(); | ||
939 | QVERIFY(window2); | 939 | QVERIFY(window2); | ||
940 | QVERIFY(window1 != window2); | 940 | QVERIFY(window1 != window2); | ||
941 | QSignalSpy window2DestroyedSpy(window2, &QObject::destroyed); | 941 | QSignalSpy window2DestroyedSpy(window2, &QObject::destroyed); | ||
942 | QVERIFY(window2DestroyedSpy.isValid()); | 942 | QVERIFY(window2DestroyedSpy.isValid()); | ||
943 | QCOMPARE(workspace()->topClientOnDesktop(1, -1), window2); | 943 | QCOMPARE(workspace()->topClientOnDesktop(1, -1), window2); | ||
944 | // geometry of the two windows should be overlapping | 944 | // geometry of the two windows should be overlapping | ||
945 | QVERIFY(window1->geometry().intersects(window2->geometry())); | 945 | QVERIFY(window1->frameGeometry().intersects(window2->frameGeometry())); | ||
946 | // lower the currently active window | 946 | // lower the currently active window | ||
947 | workspace()->lowerClient(window2); | 947 | workspace()->lowerClient(window2); | ||
948 | QCOMPARE(workspace()->topClientOnDesktop(1, -1), window1); | 948 | QCOMPARE(workspace()->topClientOnDesktop(1, -1), window1); | ||
949 | 949 | | |||
950 | // signal spy for stacking order spy | 950 | // signal spy for stacking order spy | ||
951 | QSignalSpy stackingOrderChangedSpy(workspace(), &Workspace::stackingOrderChanged); | 951 | QSignalSpy stackingOrderChangedSpy(workspace(), &Workspace::stackingOrderChanged); | ||
952 | QVERIFY(stackingOrderChangedSpy.isValid()); | 952 | QVERIFY(stackingOrderChangedSpy.isValid()); | ||
953 | 953 | | |||
954 | // move on top of second window | 954 | // move on top of second window | ||
955 | QVERIFY(!window1->geometry().contains(900, 900)); | 955 | QVERIFY(!window1->frameGeometry().contains(900, 900)); | ||
956 | QVERIFY(window2->geometry().contains(900, 900)); | 956 | QVERIFY(window2->frameGeometry().contains(900, 900)); | ||
957 | Cursor::setPos(900, 900); | 957 | Cursor::setPos(900, 900); | ||
958 | 958 | | |||
959 | // and click | 959 | // and click | ||
960 | quint32 timestamp = 1; | 960 | quint32 timestamp = 1; | ||
961 | QFETCH(quint32, button); | 961 | QFETCH(quint32, button); | ||
962 | kwinApp()->platform()->pointerButtonPressed(button, timestamp++); | 962 | kwinApp()->platform()->pointerButtonPressed(button, timestamp++); | ||
963 | QVERIFY(buttonSpy.wait()); | 963 | QVERIFY(buttonSpy.wait()); | ||
964 | if (clickRaise) { | 964 | if (clickRaise) { | ||
Show All 40 Lines | 983 | { | |||
1005 | XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface); | 1005 | XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface); | ||
1006 | QVERIFY(shellSurface); | 1006 | QVERIFY(shellSurface); | ||
1007 | render(surface); | 1007 | render(surface); | ||
1008 | QVERIFY(clientAddedSpy.wait()); | 1008 | QVERIFY(clientAddedSpy.wait()); | ||
1009 | AbstractClient *window = workspace()->activeClient(); | 1009 | AbstractClient *window = workspace()->activeClient(); | ||
1010 | QVERIFY(window); | 1010 | QVERIFY(window); | ||
1011 | 1011 | | |||
1012 | // move cursor to center of window, this should first set a null pointer, so we still show old cursor | 1012 | // move cursor to center of window, this should first set a null pointer, so we still show old cursor | ||
1013 | Cursor::setPos(window->geometry().center()); | 1013 | Cursor::setPos(window->frameGeometry().center()); | ||
1014 | QCOMPARE(p->focus().data(), window); | 1014 | QCOMPARE(p->focus().data(), window); | ||
1015 | QCOMPARE(p->cursorImage(), fallbackCursor); | 1015 | QCOMPARE(p->cursorImage(), fallbackCursor); | ||
1016 | QVERIFY(enteredSpy.wait()); | 1016 | QVERIFY(enteredSpy.wait()); | ||
1017 | 1017 | | |||
1018 | // create a cursor on the pointer | 1018 | // create a cursor on the pointer | ||
1019 | Surface *cursorSurface = Test::createSurface(m_compositor); | 1019 | Surface *cursorSurface = Test::createSurface(m_compositor); | ||
1020 | QVERIFY(cursorSurface); | 1020 | QVERIFY(cursorSurface); | ||
1021 | QSignalSpy cursorRenderedSpy(cursorSurface, &Surface::frameRendered); | 1021 | QSignalSpy cursorRenderedSpy(cursorSurface, &Surface::frameRendered); | ||
Show All 38 Lines | |||||
1060 | QCOMPARE(p->cursorHotSpot(), QPoint(6, 6)); //surface-local (so not changed) | 1060 | QCOMPARE(p->cursorHotSpot(), QPoint(6, 6)); //surface-local (so not changed) | ||
1061 | 1061 | | |||
1062 | // hide the cursor | 1062 | // hide the cursor | ||
1063 | pointer->setCursor(nullptr); | 1063 | pointer->setCursor(nullptr); | ||
1064 | Test::flushWaylandConnection(); | 1064 | Test::flushWaylandConnection(); | ||
1065 | QTRY_VERIFY(p->cursorImage().isNull()); | 1065 | QTRY_VERIFY(p->cursorImage().isNull()); | ||
1066 | 1066 | | |||
1067 | // move cursor somewhere else, should reset to fallback cursor | 1067 | // move cursor somewhere else, should reset to fallback cursor | ||
1068 | Cursor::setPos(window->geometry().bottomLeft() + QPoint(20, 20)); | 1068 | Cursor::setPos(window->frameGeometry().bottomLeft() + QPoint(20, 20)); | ||
1069 | QVERIFY(p->focus().isNull()); | 1069 | QVERIFY(p->focus().isNull()); | ||
1070 | QVERIFY(!p->cursorImage().isNull()); | 1070 | QVERIFY(!p->cursorImage().isNull()); | ||
1071 | QCOMPARE(p->cursorImage(), fallbackCursor); | 1071 | QCOMPARE(p->cursorImage(), fallbackCursor); | ||
1072 | } | 1072 | } | ||
1073 | 1073 | | |||
1074 | class HelperEffect : public Effect | 1074 | class HelperEffect : public Effect | ||
1075 | { | 1075 | { | ||
1076 | Q_OBJECT | 1076 | Q_OBJECT | ||
Show All 29 Lines | 1083 | { | |||
1106 | XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface); | 1106 | XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface); | ||
1107 | QVERIFY(shellSurface); | 1107 | QVERIFY(shellSurface); | ||
1108 | render(surface); | 1108 | render(surface); | ||
1109 | QVERIFY(clientAddedSpy.wait()); | 1109 | QVERIFY(clientAddedSpy.wait()); | ||
1110 | AbstractClient *window = workspace()->activeClient(); | 1110 | AbstractClient *window = workspace()->activeClient(); | ||
1111 | QVERIFY(window); | 1111 | QVERIFY(window); | ||
1112 | 1112 | | |||
1113 | // and move cursor to the window | 1113 | // and move cursor to the window | ||
1114 | QVERIFY(!window->geometry().contains(QPoint(800, 800))); | 1114 | QVERIFY(!window->frameGeometry().contains(QPoint(800, 800))); | ||
1115 | Cursor::setPos(window->geometry().center()); | 1115 | Cursor::setPos(window->frameGeometry().center()); | ||
1116 | QVERIFY(enteredSpy.wait()); | 1116 | QVERIFY(enteredSpy.wait()); | ||
1117 | // cursor image should still be fallback | 1117 | // cursor image should still be fallback | ||
1118 | QCOMPARE(p->cursorImage(), fallback); | 1118 | QCOMPARE(p->cursorImage(), fallback); | ||
1119 | 1119 | | |||
1120 | // now create an effect and set an override cursor | 1120 | // now create an effect and set an override cursor | ||
1121 | QScopedPointer<HelperEffect> effect(new HelperEffect); | 1121 | QScopedPointer<HelperEffect> effect(new HelperEffect); | ||
1122 | effects->startMouseInterception(effect.data(), Qt::SizeAllCursor); | 1122 | effects->startMouseInterception(effect.data(), Qt::SizeAllCursor); | ||
1123 | const QImage sizeAll = p->cursorImage(); | 1123 | const QImage sizeAll = p->cursorImage(); | ||
Show All 15 Lines | |||||
1139 | effects->stopMouseInterception(effect.data()); | 1139 | effects->stopMouseInterception(effect.data()); | ||
1140 | QCOMPARE(p->cursorImage(), fallback); | 1140 | QCOMPARE(p->cursorImage(), fallback); | ||
1141 | 1141 | | |||
1142 | // start mouse interception again | 1142 | // start mouse interception again | ||
1143 | effects->startMouseInterception(effect.data(), Qt::SizeAllCursor); | 1143 | effects->startMouseInterception(effect.data(), Qt::SizeAllCursor); | ||
1144 | QCOMPARE(p->cursorImage(), sizeAll); | 1144 | QCOMPARE(p->cursorImage(), sizeAll); | ||
1145 | 1145 | | |||
1146 | // move cursor to area of window | 1146 | // move cursor to area of window | ||
1147 | Cursor::setPos(window->geometry().center()); | 1147 | Cursor::setPos(window->frameGeometry().center()); | ||
1148 | // this should not result in an enter event | 1148 | // this should not result in an enter event | ||
1149 | QVERIFY(!enteredSpy.wait(100)); | 1149 | QVERIFY(!enteredSpy.wait(100)); | ||
1150 | 1150 | | |||
1151 | // after ending the interception we should get an enter event | 1151 | // after ending the interception we should get an enter event | ||
1152 | effects->stopMouseInterception(effect.data()); | 1152 | effects->stopMouseInterception(effect.data()); | ||
1153 | QVERIFY(enteredSpy.wait()); | 1153 | QVERIFY(enteredSpy.wait()); | ||
1154 | QVERIFY(p->cursorImage().isNull()); | 1154 | QVERIFY(p->cursorImage().isNull()); | ||
1155 | } | 1155 | } | ||
Show All 26 Lines | 1158 | { | |||
1182 | XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface); | 1182 | XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface); | ||
1183 | QVERIFY(shellSurface); | 1183 | QVERIFY(shellSurface); | ||
1184 | render(surface); | 1184 | render(surface); | ||
1185 | QVERIFY(clientAddedSpy.wait()); | 1185 | QVERIFY(clientAddedSpy.wait()); | ||
1186 | AbstractClient *window = workspace()->activeClient(); | 1186 | AbstractClient *window = workspace()->activeClient(); | ||
1187 | QVERIFY(window); | 1187 | QVERIFY(window); | ||
1188 | QCOMPARE(window->hasPopupGrab(), false); | 1188 | QCOMPARE(window->hasPopupGrab(), false); | ||
1189 | // move pointer into window | 1189 | // move pointer into window | ||
1190 | QVERIFY(!window->geometry().contains(QPoint(800, 800))); | 1190 | QVERIFY(!window->frameGeometry().contains(QPoint(800, 800))); | ||
1191 | Cursor::setPos(window->geometry().center()); | 1191 | Cursor::setPos(window->frameGeometry().center()); | ||
1192 | QVERIFY(enteredSpy.wait()); | 1192 | QVERIFY(enteredSpy.wait()); | ||
1193 | // click inside window to create serial | 1193 | // click inside window to create serial | ||
1194 | quint32 timestamp = 0; | 1194 | quint32 timestamp = 0; | ||
1195 | kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); | 1195 | kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); | ||
1196 | kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++); | 1196 | kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++); | ||
1197 | QVERIFY(buttonStateChangedSpy.wait()); | 1197 | QVERIFY(buttonStateChangedSpy.wait()); | ||
1198 | 1198 | | |||
1199 | // now create the popup surface | 1199 | // now create the popup surface | ||
Show All 13 Lines | |||||
1213 | QVERIFY(popupClient); | 1213 | QVERIFY(popupClient); | ||
1214 | QVERIFY(popupClient != window); | 1214 | QVERIFY(popupClient != window); | ||
1215 | QCOMPARE(window, workspace()->activeClient()); | 1215 | QCOMPARE(window, workspace()->activeClient()); | ||
1216 | QCOMPARE(popupClient->transientFor(), window); | 1216 | QCOMPARE(popupClient->transientFor(), window); | ||
1217 | QCOMPARE(popupClient->pos(), window->pos() + QPoint(80, 20)); | 1217 | QCOMPARE(popupClient->pos(), window->pos() + QPoint(80, 20)); | ||
1218 | QCOMPARE(popupClient->hasPopupGrab(), true); | 1218 | QCOMPARE(popupClient->hasPopupGrab(), true); | ||
1219 | 1219 | | |||
1220 | // let's move the pointer into the center of the window | 1220 | // let's move the pointer into the center of the window | ||
1221 | Cursor::setPos(popupClient->geometry().center()); | 1221 | Cursor::setPos(popupClient->frameGeometry().center()); | ||
1222 | QVERIFY(enteredSpy.wait()); | 1222 | QVERIFY(enteredSpy.wait()); | ||
1223 | QCOMPARE(enteredSpy.count(), 2); | 1223 | QCOMPARE(enteredSpy.count(), 2); | ||
1224 | QCOMPARE(leftSpy.count(), 1); | 1224 | QCOMPARE(leftSpy.count(), 1); | ||
1225 | QCOMPARE(pointer->enteredSurface(), popupSurface); | 1225 | QCOMPARE(pointer->enteredSurface(), popupSurface); | ||
1226 | 1226 | | |||
1227 | // let's move the pointer outside of the popup window | 1227 | // let's move the pointer outside of the popup window | ||
1228 | // this should not really change anything, it gets a leave event | 1228 | // this should not really change anything, it gets a leave event | ||
1229 | Cursor::setPos(popupClient->geometry().bottomRight() + QPoint(2, 2)); | 1229 | Cursor::setPos(popupClient->frameGeometry().bottomRight() + QPoint(2, 2)); | ||
1230 | QVERIFY(leftSpy.wait()); | 1230 | QVERIFY(leftSpy.wait()); | ||
1231 | QCOMPARE(leftSpy.count(), 2); | 1231 | QCOMPARE(leftSpy.count(), 2); | ||
1232 | QVERIFY(popupDoneSpy.isEmpty()); | 1232 | QVERIFY(popupDoneSpy.isEmpty()); | ||
1233 | // now click, should trigger popupDone | 1233 | // now click, should trigger popupDone | ||
1234 | kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); | 1234 | kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); | ||
1235 | QVERIFY(popupDoneSpy.wait()); | 1235 | QVERIFY(popupDoneSpy.wait()); | ||
1236 | kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++); | 1236 | kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++); | ||
1237 | } | 1237 | } | ||
Show All 35 Lines | 1240 | { | |||
1273 | render(surface); | 1273 | render(surface); | ||
1274 | QVERIFY(clientAddedSpy.wait()); | 1274 | QVERIFY(clientAddedSpy.wait()); | ||
1275 | AbstractClient *window = workspace()->activeClient(); | 1275 | AbstractClient *window = workspace()->activeClient(); | ||
1276 | QVERIFY(window); | 1276 | QVERIFY(window); | ||
1277 | QCOMPARE(window->hasPopupGrab(), false); | 1277 | QCOMPARE(window->hasPopupGrab(), false); | ||
1278 | QVERIFY(window->isDecorated()); | 1278 | QVERIFY(window->isDecorated()); | ||
1279 | 1279 | | |||
1280 | // move pointer into window | 1280 | // move pointer into window | ||
1281 | QVERIFY(!window->geometry().contains(QPoint(800, 800))); | 1281 | QVERIFY(!window->frameGeometry().contains(QPoint(800, 800))); | ||
1282 | Cursor::setPos(window->geometry().center()); | 1282 | Cursor::setPos(window->frameGeometry().center()); | ||
1283 | QVERIFY(enteredSpy.wait()); | 1283 | QVERIFY(enteredSpy.wait()); | ||
1284 | // click inside window to create serial | 1284 | // click inside window to create serial | ||
1285 | quint32 timestamp = 0; | 1285 | quint32 timestamp = 0; | ||
1286 | kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); | 1286 | kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); | ||
1287 | kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++); | 1287 | kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++); | ||
1288 | QVERIFY(buttonStateChangedSpy.wait()); | 1288 | QVERIFY(buttonStateChangedSpy.wait()); | ||
1289 | 1289 | | |||
1290 | // now create the popup surface | 1290 | // now create the popup surface | ||
Show All 13 Lines | |||||
1304 | QVERIFY(popupClient); | 1304 | QVERIFY(popupClient); | ||
1305 | QVERIFY(popupClient != window); | 1305 | QVERIFY(popupClient != window); | ||
1306 | QCOMPARE(window, workspace()->activeClient()); | 1306 | QCOMPARE(window, workspace()->activeClient()); | ||
1307 | QCOMPARE(popupClient->transientFor(), window); | 1307 | QCOMPARE(popupClient->transientFor(), window); | ||
1308 | QCOMPARE(popupClient->pos(), window->pos() + window->clientPos() + QPoint(80, 20)); | 1308 | QCOMPARE(popupClient->pos(), window->pos() + window->clientPos() + QPoint(80, 20)); | ||
1309 | QCOMPARE(popupClient->hasPopupGrab(), true); | 1309 | QCOMPARE(popupClient->hasPopupGrab(), true); | ||
1310 | 1310 | | |||
1311 | // let's move the pointer into the center of the deco | 1311 | // let's move the pointer into the center of the deco | ||
1312 | Cursor::setPos(window->geometry().center().x(), window->y() + (window->height() - window->clientSize().height()) / 2); | 1312 | Cursor::setPos(window->frameGeometry().center().x(), window->y() + (window->height() - window->clientSize().height()) / 2); | ||
1313 | 1313 | | |||
1314 | kwinApp()->platform()->pointerButtonPressed(BTN_RIGHT, timestamp++); | 1314 | kwinApp()->platform()->pointerButtonPressed(BTN_RIGHT, timestamp++); | ||
1315 | QVERIFY(popupDoneSpy.wait()); | 1315 | QVERIFY(popupDoneSpy.wait()); | ||
1316 | kwinApp()->platform()->pointerButtonReleased(BTN_RIGHT, timestamp++); | 1316 | kwinApp()->platform()->pointerButtonReleased(BTN_RIGHT, timestamp++); | ||
1317 | } | 1317 | } | ||
1318 | 1318 | | |||
1319 | void PointerInputTest::testWindowUnderCursorWhileButtonPressed() | 1319 | void PointerInputTest::testWindowUnderCursorWhileButtonPressed() | ||
1320 | { | 1320 | { | ||
Show All 19 Lines | |||||
1340 | XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface); | 1340 | XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface); | ||
1341 | QVERIFY(shellSurface); | 1341 | QVERIFY(shellSurface); | ||
1342 | render(surface); | 1342 | render(surface); | ||
1343 | QVERIFY(clientAddedSpy.wait()); | 1343 | QVERIFY(clientAddedSpy.wait()); | ||
1344 | AbstractClient *window = workspace()->activeClient(); | 1344 | AbstractClient *window = workspace()->activeClient(); | ||
1345 | QVERIFY(window); | 1345 | QVERIFY(window); | ||
1346 | 1346 | | |||
1347 | // move cursor over window | 1347 | // move cursor over window | ||
1348 | QVERIFY(!window->geometry().contains(QPoint(800, 800))); | 1348 | QVERIFY(!window->frameGeometry().contains(QPoint(800, 800))); | ||
1349 | Cursor::setPos(window->geometry().center()); | 1349 | Cursor::setPos(window->frameGeometry().center()); | ||
1350 | QVERIFY(enteredSpy.wait()); | 1350 | QVERIFY(enteredSpy.wait()); | ||
1351 | // click inside window | 1351 | // click inside window | ||
1352 | quint32 timestamp = 0; | 1352 | quint32 timestamp = 0; | ||
1353 | kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); | 1353 | kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); | ||
1354 | 1354 | | |||
1355 | // now create a second window as transient | 1355 | // now create a second window as transient | ||
1356 | XdgPositioner positioner(QSize(99, 49), QRect(0, 0, 1, 1)); | 1356 | XdgPositioner positioner(QSize(99, 49), QRect(0, 0, 1, 1)); | ||
1357 | positioner.setAnchorEdge(Qt::BottomEdge | Qt::RightEdge); | 1357 | positioner.setAnchorEdge(Qt::BottomEdge | Qt::RightEdge); | ||
1358 | positioner.setGravity(Qt::BottomEdge | Qt::RightEdge); | 1358 | positioner.setGravity(Qt::BottomEdge | Qt::RightEdge); | ||
1359 | Surface *popupSurface = Test::createSurface(m_compositor); | 1359 | Surface *popupSurface = Test::createSurface(m_compositor); | ||
1360 | QVERIFY(popupSurface); | 1360 | QVERIFY(popupSurface); | ||
1361 | XdgShellPopup *popupShellSurface = Test::createXdgShellStablePopup(popupSurface, shellSurface, positioner); | 1361 | XdgShellPopup *popupShellSurface = Test::createXdgShellStablePopup(popupSurface, shellSurface, positioner); | ||
1362 | QVERIFY(popupShellSurface); | 1362 | QVERIFY(popupShellSurface); | ||
1363 | render(popupSurface, positioner.initialSize()); | 1363 | render(popupSurface, positioner.initialSize()); | ||
1364 | QVERIFY(clientAddedSpy.wait()); | 1364 | QVERIFY(clientAddedSpy.wait()); | ||
1365 | auto popupClient = clientAddedSpy.last().first().value<XdgShellClient *>(); | 1365 | auto popupClient = clientAddedSpy.last().first().value<XdgShellClient *>(); | ||
1366 | QVERIFY(popupClient); | 1366 | QVERIFY(popupClient); | ||
1367 | QVERIFY(popupClient != window); | 1367 | QVERIFY(popupClient != window); | ||
1368 | QVERIFY(window->geometry().contains(Cursor::pos())); | 1368 | QVERIFY(window->frameGeometry().contains(Cursor::pos())); | ||
1369 | QVERIFY(popupClient->geometry().contains(Cursor::pos())); | 1369 | QVERIFY(popupClient->frameGeometry().contains(Cursor::pos())); | ||
1370 | QVERIFY(!leftSpy.wait()); | 1370 | QVERIFY(!leftSpy.wait()); | ||
1371 | 1371 | | |||
1372 | kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++); | 1372 | kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++); | ||
1373 | // now that the button is no longer pressed we should get the leave event | 1373 | // now that the button is no longer pressed we should get the leave event | ||
1374 | QVERIFY(leftSpy.wait()); | 1374 | QVERIFY(leftSpy.wait()); | ||
1375 | QCOMPARE(leftSpy.count(), 1); | 1375 | QCOMPARE(leftSpy.count(), 1); | ||
1376 | QCOMPARE(enteredSpy.count(), 2); | 1376 | QCOMPARE(enteredSpy.count(), 2); | ||
1377 | } | 1377 | } | ||
▲ Show 20 Lines • Show All 126 Lines • ▼ Show 20 Line(s) | 1486 | { | |||
1504 | XdgShellClient *c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | 1504 | XdgShellClient *c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | ||
1505 | QVERIFY(c); | 1505 | QVERIFY(c); | ||
1506 | 1506 | | |||
1507 | // move the cursor to the test position | 1507 | // move the cursor to the test position | ||
1508 | QPoint cursorPos; | 1508 | QPoint cursorPos; | ||
1509 | QFETCH(Qt::Edges, edges); | 1509 | QFETCH(Qt::Edges, edges); | ||
1510 | 1510 | | |||
1511 | if (edges & Qt::LeftEdge) { | 1511 | if (edges & Qt::LeftEdge) { | ||
1512 | cursorPos.setX(c->geometry().left()); | 1512 | cursorPos.setX(c->frameGeometry().left()); | ||
1513 | } else if (edges & Qt::RightEdge) { | 1513 | } else if (edges & Qt::RightEdge) { | ||
1514 | cursorPos.setX(c->geometry().right()); | 1514 | cursorPos.setX(c->frameGeometry().right()); | ||
1515 | } else { | 1515 | } else { | ||
1516 | cursorPos.setX(c->geometry().center().x()); | 1516 | cursorPos.setX(c->frameGeometry().center().x()); | ||
1517 | } | 1517 | } | ||
1518 | 1518 | | |||
1519 | if (edges & Qt::TopEdge) { | 1519 | if (edges & Qt::TopEdge) { | ||
1520 | cursorPos.setY(c->geometry().top()); | 1520 | cursorPos.setY(c->frameGeometry().top()); | ||
1521 | } else if (edges & Qt::BottomEdge) { | 1521 | } else if (edges & Qt::BottomEdge) { | ||
1522 | cursorPos.setY(c->geometry().bottom()); | 1522 | cursorPos.setY(c->frameGeometry().bottom()); | ||
1523 | } else { | 1523 | } else { | ||
1524 | cursorPos.setY(c->geometry().center().y()); | 1524 | cursorPos.setY(c->frameGeometry().center().y()); | ||
1525 | } | 1525 | } | ||
1526 | 1526 | | |||
1527 | Cursor::setPos(cursorPos); | 1527 | Cursor::setPos(cursorPos); | ||
1528 | 1528 | | |||
1529 | const PlatformCursorImage arrowCursor = loadReferenceThemeCursor(Qt::ArrowCursor); | 1529 | const PlatformCursorImage arrowCursor = loadReferenceThemeCursor(Qt::ArrowCursor); | ||
1530 | QVERIFY(!arrowCursor.image().isNull()); | 1530 | QVERIFY(!arrowCursor.image().isNull()); | ||
1531 | QCOMPARE(kwinApp()->platform()->cursorImage().image(), arrowCursor.image()); | 1531 | QCOMPARE(kwinApp()->platform()->cursorImage().image(), arrowCursor.image()); | ||
1532 | QCOMPARE(kwinApp()->platform()->cursorImage().hotSpot(), arrowCursor.hotSpot()); | 1532 | QCOMPARE(kwinApp()->platform()->cursorImage().hotSpot(), arrowCursor.hotSpot()); | ||
Show All 37 Lines | 1556 | { | |||
1570 | QScopedPointer<Surface> surface(Test::createSurface()); | 1570 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
1571 | QVERIFY(!surface.isNull()); | 1571 | QVERIFY(!surface.isNull()); | ||
1572 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | 1572 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | ||
1573 | QVERIFY(!shellSurface.isNull()); | 1573 | QVERIFY(!shellSurface.isNull()); | ||
1574 | XdgShellClient *c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | 1574 | XdgShellClient *c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | ||
1575 | QVERIFY(c); | 1575 | QVERIFY(c); | ||
1576 | 1576 | | |||
1577 | // move cursor to the test position | 1577 | // move cursor to the test position | ||
1578 | Cursor::setPos(c->geometry().center()); | 1578 | Cursor::setPos(c->frameGeometry().center()); | ||
1579 | 1579 | | |||
1580 | const PlatformCursorImage arrowCursor = loadReferenceThemeCursor(Qt::ArrowCursor); | 1580 | const PlatformCursorImage arrowCursor = loadReferenceThemeCursor(Qt::ArrowCursor); | ||
1581 | QVERIFY(!arrowCursor.image().isNull()); | 1581 | QVERIFY(!arrowCursor.image().isNull()); | ||
1582 | QCOMPARE(kwinApp()->platform()->cursorImage().image(), arrowCursor.image()); | 1582 | QCOMPARE(kwinApp()->platform()->cursorImage().image(), arrowCursor.image()); | ||
1583 | QCOMPARE(kwinApp()->platform()->cursorImage().hotSpot(), arrowCursor.hotSpot()); | 1583 | QCOMPARE(kwinApp()->platform()->cursorImage().hotSpot(), arrowCursor.hotSpot()); | ||
1584 | 1584 | | |||
1585 | // start moving the client | 1585 | // start moving the client | ||
1586 | int timestamp = 1; | 1586 | int timestamp = 1; | ||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |