diff options
-rw-r--r-- | src/client/qwaylanddnd.cpp | 2 | ||||
-rw-r--r-- | src/client/qwaylandinputdevice.cpp | 16 | ||||
-rw-r--r-- | src/client/qwaylandinputdevice_p.h | 2 |
3 files changed, 19 insertions, 1 deletions
diff --git a/src/client/qwaylanddnd.cpp b/src/client/qwaylanddnd.cpp index 31b1c4911..7c2cc8ee0 100644 --- a/src/client/qwaylanddnd.cpp +++ b/src/client/qwaylanddnd.cpp @@ -91,7 +91,7 @@ void QWaylandDrag::drop(const QPoint &globalPos) void QWaylandDrag::endDrag() { - // Do nothing + m_display->currentInputDevice()->handleEndDrag(); } void QWaylandDrag::updateTarget(const QString &mimeType) diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index 6c72c59d7..669deac2a 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -256,6 +256,12 @@ void QWaylandInputDevice::handleWindowDestroyed(QWaylandWindow *window) mTouch->mFocus = 0; } +void QWaylandInputDevice::handleEndDrag() +{ + if (mTouch) + mTouch->releasePoints(); +} + void QWaylandInputDevice::setDataDevice(QWaylandDataDevice *device) { mDataDevice = device; @@ -827,6 +833,16 @@ bool QWaylandInputDevice::Touch::allTouchPointsReleased() return true; } +void QWaylandInputDevice::Touch::releasePoints() +{ + Q_FOREACH (const QWindowSystemInterface::TouchPoint &previousPoint, mPrevTouchPoints) { + QWindowSystemInterface::TouchPoint tp = previousPoint; + tp.state = Qt::TouchPointReleased; + mTouchPoints.append(tp); + } + touch_frame(); +} + void QWaylandInputDevice::Touch::touch_frame() { // Copy all points, that are in the previous but not in the current list, as stationary. diff --git a/src/client/qwaylandinputdevice_p.h b/src/client/qwaylandinputdevice_p.h index e38ad2f84..f1a82d45b 100644 --- a/src/client/qwaylandinputdevice_p.h +++ b/src/client/qwaylandinputdevice_p.h @@ -98,6 +98,7 @@ public: void setCursor(struct wl_buffer *buffer, const QPoint &hotSpot, const QSize &size); void setCursor(const QSharedPointer<QWaylandBuffer> &buffer, const QPoint &hotSpot); void handleWindowDestroyed(QWaylandWindow *window); + void handleEndDrag(); void setDataDevice(QWaylandDataDevice *device); QWaylandDataDevice *dataDevice() const; @@ -259,6 +260,7 @@ public: void touch_cancel() Q_DECL_OVERRIDE; bool allTouchPointsReleased(); + void releasePoints(); QWaylandInputDevice *mParent; QWaylandWindow *mFocus; |