From 6698deaa46d9798aab6aabcb6667d440d90a14f6 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 10 May 2017 21:57:10 +0200 Subject: [PATCH] Pass modifiers with wheel events Change-Id: I345cdeea1357a8f9201a74b2d5e80350b6c42f24 Reviewed-by: Giulio Camuffo --- src/plugins/platforms/wayland/qwaylandinputdevice.cpp | 6 +++--- src/plugins/platforms/wayland/qwaylandinputdevice_p.h | 3 ++- src/plugins/platforms/wayland/qwaylandwindow.cpp | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp index b0c6394e2b0..59dcb1d77e3 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandinputdevice_p.h b/src/plugins/platforms/wayland/qwaylandinputdevice_p.h index 4d0a4759751..9e3d1d1f449 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice_p.h +++ b/src/plugins/platforms/wayland/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/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index 3a216e12718..a70a4f54b27 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/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; }