Pass modifiers with wheel events

Change-Id: I345cdeea1357a8f9201a74b2d5e80350b6c42f24
Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
This commit is contained in:
David Edmundson 2017-05-10 21:57:10 +02:00
parent 07a8cb2d91
commit 6698deaa46
3 changed files with 7 additions and 6 deletions

View File

@ -583,8 +583,8 @@ void QWaylandInputDevice::Pointer::releaseButtons()
class WheelEvent : public QWaylandPointerEvent class WheelEvent : public QWaylandPointerEvent
{ {
public: public:
WheelEvent(ulong t, const QPointF &l, const QPointF &g, const QPoint &pd, const QPoint &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) : 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); angleDelta.setY(valueDelta);
} }
WheelEvent e(time, mSurfacePos, mGlobalPos, pixelDelta, angleDelta); WheelEvent e(time, mSurfacePos, mGlobalPos, pixelDelta, angleDelta, mParent->modifiers());
window->handleMouse(mParent, e); window->handleMouse(mParent, e);
} }

View File

@ -314,11 +314,12 @@ public:
, buttons(b) , buttons(b)
, modifiers(m) , 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) : type(t)
, timestamp(ts) , timestamp(ts)
, local(l) , local(l)
, global(g) , global(g)
, modifiers(m)
, pixelDelta(pd) , pixelDelta(pd)
, angleDelta(ad) , angleDelta(ad)
{} {}

View File

@ -728,7 +728,7 @@ void QWaylandWindow::handleMouse(QWaylandInputDevice *inputDevice, const QWaylan
QWindowSystemInterface::handleMouseEvent(window(), e.timestamp, e.local, e.global, e.buttons, e.modifiers); QWindowSystemInterface::handleMouseEvent(window(), e.timestamp, e.local, e.global, e.buttons, e.modifiers);
break; break;
case QWaylandPointerEvent::Wheel: 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; break;
} }
} }
@ -796,7 +796,7 @@ void QWaylandWindow::handleMouseEventWithDecoration(QWaylandInputDevice *inputDe
QWindowSystemInterface::handleMouseEvent(window(), e.timestamp, localTranslated, globalTranslated, e.buttons, e.modifiers); QWindowSystemInterface::handleMouseEvent(window(), e.timestamp, localTranslated, globalTranslated, e.buttons, e.modifiers);
break; break;
case QWaylandPointerEvent::Wheel: 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; break;
} }