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
{
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);
}

View File

@ -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)
{}

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);
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;
}