summaryrefslogtreecommitdiff
path: root/src/client/qwaylandinputdevice_p.h
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2019-10-21 12:02:15 +0200
committerJohan Klokkhammer Helsing <johan.helsing@qt.io>2020-01-03 23:47:02 +0100
commiteaf72c8ffdcdc6e9a3e1e3d67bf09db1dabe7af6 (patch)
tree705871987df521c50de0442273c0cacfd0d24a7e /src/client/qwaylandinputdevice_p.h
parent919efcd994b5284bb73e11859ca953e9186b0bae (diff)
downloadqtwayland-eaf72c8ffdcdc6e9a3e1e3d67bf09db1dabe7af6.tar.gz
Client: Don't use deprecated handleMouseEvent version
The new version requires the button that caused the event, as well as the event type. Instead of adding a conversion functions to and from QWaylandInputDevice::Type to QEvent::Type, just use QEvent::Type directly, as there is one-to-one mappings for all the event types we need. Fixes: QTBUG-80044 Change-Id: I0f6e0e8e7f2e026a1d601f86e819affe0570a1b2 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
Diffstat (limited to 'src/client/qwaylandinputdevice_p.h')
-rw-r--r--src/client/qwaylandinputdevice_p.h21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/client/qwaylandinputdevice_p.h b/src/client/qwaylandinputdevice_p.h
index a567c57b..87f8559c 100644
--- a/src/client/qwaylandinputdevice_p.h
+++ b/src/client/qwaylandinputdevice_p.h
@@ -401,29 +401,21 @@ class QWaylandPointerEvent
{
Q_GADGET
public:
- enum Type {
- Enter,
- Leave,
- Motion,
- Press,
- Release,
- Wheel
- };
- Q_ENUM(Type)
-
- inline QWaylandPointerEvent(Type type, Qt::ScrollPhase phase, QWaylandWindow *surface,
+ inline QWaylandPointerEvent(QEvent::Type type, Qt::ScrollPhase phase, QWaylandWindow *surface,
ulong timestamp, const QPointF &localPos, const QPointF &globalPos,
- Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
+ Qt::MouseButtons buttons, Qt::MouseButton button,
+ Qt::KeyboardModifiers modifiers)
: type(type)
, phase(phase)
, timestamp(timestamp)
, local(localPos)
, global(globalPos)
, buttons(buttons)
+ , button(button)
, modifiers(modifiers)
, surface(surface)
{}
- inline QWaylandPointerEvent(Type type, Qt::ScrollPhase phase, QWaylandWindow *surface,
+ inline QWaylandPointerEvent(QEvent::Type type, Qt::ScrollPhase phase, QWaylandWindow *surface,
ulong timestamp, const QPointF &local, const QPointF &global,
const QPoint &pixelDelta, const QPoint &angleDelta,
Qt::MouseEventSource source,
@@ -440,12 +432,13 @@ public:
, surface(surface)
{}
- Type type;
+ QEvent::Type type = QEvent::None;
Qt::ScrollPhase phase = Qt::NoScrollPhase;
ulong timestamp = 0;
QPointF local;
QPointF global;
Qt::MouseButtons buttons;
+ Qt::MouseButton button = Qt::NoButton; // Button that caused the event (QMouseEvent::button)
Qt::KeyboardModifiers modifiers;
QPoint pixelDelta;
QPoint angleDelta;