diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2016-10-12 15:29:30 +0200 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2016-11-10 08:07:35 +0000 |
commit | f7a386eeaec8e6314c1be7de5e14e9fe3847f9ba (patch) | |
tree | 0b3ce20b31d5ac779b082471896bd73c8894fd1c | |
parent | 296912c3a3ccdc48cdc318d761b4154a8d7db359 (diff) | |
download | qtwayland-f7a386eeaec8e6314c1be7de5e14e9fe3847f9ba.tar.gz |
Client: Cleanup mouse state after drag
Fixes an issue where dragging with the mouse would cause the next touch event
to not generate a synthesized mouse press event.
The touchDrag test can now be run directly after the mouseDrag test without
failing.
Task-number: QTBUG-56187
Change-Id: I53cc5f90fc8d8672936b23f54a017687d41c31fc
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
-rw-r--r-- | src/client/qwaylandinputdevice.cpp | 10 | ||||
-rw-r--r-- | src/client/qwaylandinputdevice_p.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index 669deac2..c3b6cf45 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -260,6 +260,8 @@ void QWaylandInputDevice::handleEndDrag() { if (mTouch) mTouch->releasePoints(); + if (mPointer) + mPointer->releaseButtons(); } void QWaylandInputDevice::setDataDevice(QWaylandDataDevice *device) @@ -516,6 +518,14 @@ void QWaylandInputDevice::Pointer::pointer_button(uint32_t serial, uint32_t time } } +void QWaylandInputDevice::Pointer::releaseButtons() +{ + mButtons = Qt::NoButton; + MotionEvent e(mParent->mTime, mSurfacePos, mGlobalPos, mButtons, mParent->modifiers()); + if (mFocus) + mFocus->handleMouse(mParent, e); +} + class WheelEvent : public QWaylandPointerEvent { public: diff --git a/src/client/qwaylandinputdevice_p.h b/src/client/qwaylandinputdevice_p.h index f1a82d45..a615e266 100644 --- a/src/client/qwaylandinputdevice_p.h +++ b/src/client/qwaylandinputdevice_p.h @@ -228,6 +228,8 @@ public: uint32_t axis, wl_fixed_t value) Q_DECL_OVERRIDE; + void releaseButtons(); + QWaylandInputDevice *mParent; QWaylandWindow *mFocus; uint32_t mEnterSerial; |