Changeset View
Changeset View
Standalone View
Standalone View
tests/pointerconstraintstest.cpp
Show First 20 Lines • Show All 136 Lines • ▼ Show 20 Line(s) | 133 | auto *lockedPointer = m_pointerConstraints->lockPointer(winSurface.data(), | |||
---|---|---|---|---|---|
137 | this); | 137 | this); | ||
138 | 138 | | |||
139 | if (!lockedPointer) { | 139 | if (!lockedPointer) { | ||
140 | qDebug() << "ERROR when receiving locked pointer!"; | 140 | qDebug() << "ERROR when receiving locked pointer!"; | ||
141 | return; | 141 | return; | ||
142 | } | 142 | } | ||
143 | m_lockedPointer = lockedPointer; | 143 | m_lockedPointer = lockedPointer; | ||
144 | m_lockedPointerPersistent = persistent; | 144 | m_lockedPointerPersistent = persistent; | ||
145 | | ||||
145 | connect(lockedPointer, &LockedPointer::locked, this, [this]() { | 146 | connect(lockedPointer, &LockedPointer::locked, this, [this]() { | ||
146 | qDebug() << "------ LOCKED! ------"; | 147 | qDebug() << "------ LOCKED! ------"; | ||
148 | if(lockHint()) { | ||||
149 | m_lockedPointer->setCursorPositionHint(QPointF(10., 10.)); | ||||
150 | forceSurfaceCommit(); | ||||
151 | } | ||||
152 | | ||||
147 | Q_EMIT lockChanged(true); | 153 | Q_EMIT lockChanged(true); | ||
148 | }); | 154 | }); | ||
149 | connect(lockedPointer, &LockedPointer::unlocked, this, [this]() { | 155 | connect(lockedPointer, &LockedPointer::unlocked, this, [this]() { | ||
150 | qDebug() << "------ UNLOCKED! ------"; | 156 | qDebug() << "------ UNLOCKED! ------"; | ||
151 | if (!m_lockedPointerPersistent) { | 157 | if (!m_lockedPointerPersistent) { | ||
152 | cleanupLock(); | 158 | cleanupLock(); | ||
153 | } | 159 | } | ||
154 | Q_EMIT lockChanged(false); | 160 | Q_EMIT lockChanged(false); | ||
▲ Show 20 Lines • Show All 257 Lines • Show Last 20 Lines |