Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/pointer_input.cpp
Show First 20 Lines • Show All 957 Lines • ▼ Show 20 Line(s) | 935 | { | |||
---|---|---|---|---|---|
958 | QVERIFY(shellSurface); | 958 | QVERIFY(shellSurface); | ||
959 | render(surface); | 959 | render(surface); | ||
960 | QVERIFY(clientAddedSpy.wait()); | 960 | QVERIFY(clientAddedSpy.wait()); | ||
961 | AbstractClient *window = workspace()->activeClient(); | 961 | AbstractClient *window = workspace()->activeClient(); | ||
962 | QVERIFY(window); | 962 | QVERIFY(window); | ||
963 | 963 | | |||
964 | // move cursor to center of window, this should first set a null pointer, so we still show old cursor | 964 | // move cursor to center of window, this should first set a null pointer, so we still show old cursor | ||
965 | Cursor::setPos(window->geometry().center()); | 965 | Cursor::setPos(window->geometry().center()); | ||
966 | QCOMPARE(p->window().data(), window); | 966 | QCOMPARE(p->focus().data(), window); | ||
967 | QCOMPARE(p->cursorImage(), fallbackCursor); | 967 | QCOMPARE(p->cursorImage(), fallbackCursor); | ||
968 | QVERIFY(enteredSpy.wait()); | 968 | QVERIFY(enteredSpy.wait()); | ||
969 | 969 | | |||
970 | // create a cursor on the pointer | 970 | // create a cursor on the pointer | ||
971 | Surface *cursorSurface = Test::createSurface(m_compositor); | 971 | Surface *cursorSurface = Test::createSurface(m_compositor); | ||
972 | QVERIFY(cursorSurface); | 972 | QVERIFY(cursorSurface); | ||
973 | QSignalSpy cursorRenderedSpy(cursorSurface, &Surface::frameRendered); | 973 | QSignalSpy cursorRenderedSpy(cursorSurface, &Surface::frameRendered); | ||
974 | QVERIFY(cursorRenderedSpy.isValid()); | 974 | QVERIFY(cursorRenderedSpy.isValid()); | ||
Show All 38 Lines | |||||
1013 | 1013 | | |||
1014 | // hide the cursor | 1014 | // hide the cursor | ||
1015 | pointer->setCursor(nullptr); | 1015 | pointer->setCursor(nullptr); | ||
1016 | Test::flushWaylandConnection(); | 1016 | Test::flushWaylandConnection(); | ||
1017 | QTRY_VERIFY(p->cursorImage().isNull()); | 1017 | QTRY_VERIFY(p->cursorImage().isNull()); | ||
1018 | 1018 | | |||
1019 | // move cursor somewhere else, should reset to fallback cursor | 1019 | // move cursor somewhere else, should reset to fallback cursor | ||
1020 | Cursor::setPos(window->geometry().bottomLeft() + QPoint(20, 20)); | 1020 | Cursor::setPos(window->geometry().bottomLeft() + QPoint(20, 20)); | ||
1021 | QVERIFY(p->window().isNull()); | 1021 | QVERIFY(p->focus().isNull()); | ||
1022 | QVERIFY(!p->cursorImage().isNull()); | 1022 | QVERIFY(!p->cursorImage().isNull()); | ||
1023 | QCOMPARE(p->cursorImage(), fallbackCursor); | 1023 | QCOMPARE(p->cursorImage(), fallbackCursor); | ||
1024 | } | 1024 | } | ||
1025 | 1025 | | |||
1026 | class HelperEffect : public Effect | 1026 | class HelperEffect : public Effect | ||
1027 | { | 1027 | { | ||
1028 | Q_OBJECT | 1028 | Q_OBJECT | ||
1029 | public: | 1029 | public: | ||
▲ Show 20 Lines • Show All 389 Lines • Show Last 20 Lines |