Changeset View
Changeset View
Standalone View
Standalone View
input.cpp
Show First 20 Lines • Show All 217 Lines • ▼ Show 20 Line(s) | |||||
218 | public: | 218 | public: | ||
219 | bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override { | 219 | bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override { | ||
220 | if (!waylandServer()->isScreenLocked()) { | 220 | if (!waylandServer()->isScreenLocked()) { | ||
221 | return false; | 221 | return false; | ||
222 | } | 222 | } | ||
223 | auto seat = waylandServer()->seat(); | 223 | auto seat = waylandServer()->seat(); | ||
224 | seat->setTimestamp(event->timestamp()); | 224 | seat->setTimestamp(event->timestamp()); | ||
225 | if (event->type() == QEvent::MouseMove) { | 225 | if (event->type() == QEvent::MouseMove) { | ||
226 | if (event->buttons() == Qt::NoButton) { | | |||
227 | // update pointer window only if no button is pressed | | |||
228 | input()->pointer()->update(); | 226 | input()->pointer()->update(); | ||
229 | } | | |||
230 | if (pointerSurfaceAllowed()) { | 227 | if (pointerSurfaceAllowed()) { | ||
231 | seat->setPointerPos(event->screenPos().toPoint()); | 228 | seat->setPointerPos(event->screenPos().toPoint()); | ||
232 | } | 229 | } | ||
233 | } else if (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonRelease) { | 230 | } else if (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonRelease) { | ||
234 | if (pointerSurfaceAllowed()) { | 231 | if (pointerSurfaceAllowed()) { | ||
235 | event->type() == QEvent::MouseButtonPress ? seat->pointerButtonPressed(nativeButton) : seat->pointerButtonReleased(nativeButton); | 232 | event->type() == QEvent::MouseButtonPress ? seat->pointerButtonPressed(nativeButton) : seat->pointerButtonReleased(nativeButton); | ||
236 | } | 233 | } | ||
237 | } | 234 | } | ||
▲ Show 20 Lines • Show All 1857 Lines • Show Last 20 Lines |