diff options
author | David Edmundson <davidedmundson@kde.org> | 2017-05-10 21:57:10 +0200 |
---|---|---|
committer | David Edmundson <davidedmundson@kde.org> | 2017-05-12 15:15:19 +0000 |
commit | e07d221b3029ad88fab82bcbf25e492cea626d7d (patch) | |
tree | c74af2fdbf098b967f6b838e86dd83bfc686d139 | |
parent | 0aff9f4d617690cc19c165019e736a77d44d767c (diff) | |
download | qtwayland-e07d221b3029ad88fab82bcbf25e492cea626d7d.tar.gz |
Pass modifiers with wheel events
Change-Id: I345cdeea1357a8f9201a74b2d5e80350b6c42f24
Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
-rw-r--r-- | src/client/qwaylandinputdevice.cpp | 6 | ||||
-rw-r--r-- | src/client/qwaylandinputdevice_p.h | 3 | ||||
-rw-r--r-- | src/client/qwaylandwindow.cpp | 4 |
3 files changed, 7 insertions, 6 deletions
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index b0c6394e..59dcb1d7 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -583,8 +583,8 @@ void QWaylandInputDevice::Pointer::releaseButtons() class WheelEvent : public QWaylandPointerEvent { public: - WheelEvent(ulong t, const QPointF &l, const QPointF &g, const QPoint &pd, const QPoint &ad) - : QWaylandPointerEvent(QWaylandPointerEvent::Wheel, t, l, g, pd, ad) + WheelEvent(ulong t, const QPointF &l, const QPointF &g, const QPoint &pd, const QPoint &ad, Qt::KeyboardModifiers m) + : QWaylandPointerEvent(QWaylandPointerEvent::Wheel, t, l, g, pd, ad, m) { } }; @@ -612,7 +612,7 @@ void QWaylandInputDevice::Pointer::pointer_axis(uint32_t time, uint32_t axis, in angleDelta.setY(valueDelta); } - WheelEvent e(time, mSurfacePos, mGlobalPos, pixelDelta, angleDelta); + WheelEvent e(time, mSurfacePos, mGlobalPos, pixelDelta, angleDelta, mParent->modifiers()); window->handleMouse(mParent, e); } diff --git a/src/client/qwaylandinputdevice_p.h b/src/client/qwaylandinputdevice_p.h index 4d0a4759..9e3d1d1f 100644 --- a/src/client/qwaylandinputdevice_p.h +++ b/src/client/qwaylandinputdevice_p.h @@ -314,11 +314,12 @@ public: , buttons(b) , modifiers(m) {} - inline QWaylandPointerEvent(Type t, ulong ts, const QPointF &l, const QPointF &g, const QPoint &pd, const QPoint &ad) + inline QWaylandPointerEvent(Type t, ulong ts, const QPointF &l, const QPointF &g, const QPoint &pd, const QPoint &ad, Qt::KeyboardModifiers m) : type(t) , timestamp(ts) , local(l) , global(g) + , modifiers(m) , pixelDelta(pd) , angleDelta(ad) {} diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 3a216e12..a70a4f54 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -728,7 +728,7 @@ void QWaylandWindow::handleMouse(QWaylandInputDevice *inputDevice, const QWaylan QWindowSystemInterface::handleMouseEvent(window(), e.timestamp, e.local, e.global, e.buttons, e.modifiers); break; case QWaylandPointerEvent::Wheel: - QWindowSystemInterface::handleWheelEvent(window(), e.timestamp, e.local, e.global, e.pixelDelta, e.angleDelta); + QWindowSystemInterface::handleWheelEvent(window(), e.timestamp, e.local, e.global, e.pixelDelta, e.angleDelta, e.modifiers); break; } } @@ -796,7 +796,7 @@ void QWaylandWindow::handleMouseEventWithDecoration(QWaylandInputDevice *inputDe QWindowSystemInterface::handleMouseEvent(window(), e.timestamp, localTranslated, globalTranslated, e.buttons, e.modifiers); break; case QWaylandPointerEvent::Wheel: - QWindowSystemInterface::handleWheelEvent(window(), e.timestamp, localTranslated, globalTranslated, e.pixelDelta, e.angleDelta); + QWindowSystemInterface::handleWheelEvent(window(), e.timestamp, localTranslated, globalTranslated, e.pixelDelta, e.angleDelta, e.modifiers); break; } |