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>
This commit is contained in:
parent
c8e2e7d102
commit
8d291193ab
@ -260,6 +260,8 @@ void QWaylandInputDevice::handleEndDrag()
|
|||||||
{
|
{
|
||||||
if (mTouch)
|
if (mTouch)
|
||||||
mTouch->releasePoints();
|
mTouch->releasePoints();
|
||||||
|
if (mPointer)
|
||||||
|
mPointer->releaseButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QWaylandInputDevice::setDataDevice(QWaylandDataDevice *device)
|
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
|
class WheelEvent : public QWaylandPointerEvent
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -228,6 +228,8 @@ public:
|
|||||||
uint32_t axis,
|
uint32_t axis,
|
||||||
wl_fixed_t value) Q_DECL_OVERRIDE;
|
wl_fixed_t value) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
void releaseButtons();
|
||||||
|
|
||||||
QWaylandInputDevice *mParent;
|
QWaylandInputDevice *mParent;
|
||||||
QWaylandWindow *mFocus;
|
QWaylandWindow *mFocus;
|
||||||
uint32_t mEnterSerial;
|
uint32_t mEnterSerial;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user