From 101698bd0ffa3e51186eb14cfdb317526cc9512b Mon Sep 17 00:00:00 2001 From: Giulio Camuffo Date: Sun, 4 Jan 2015 18:27:51 +0200 Subject: Send proper mouse enter events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The wl_pointer.event carries the surface local position of the pointer. Notify Qt of it, without pretending it to be a motion event. Change-Id: Ibbe1d125a93b478f9c350a50bfea25b01f628178 Reviewed-by: Jørgen Lind --- src/client/qwaylandinputdevice_p.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/client/qwaylandinputdevice_p.h') diff --git a/src/client/qwaylandinputdevice_p.h b/src/client/qwaylandinputdevice_p.h index f1c264545..a5da8bd0f 100644 --- a/src/client/qwaylandinputdevice_p.h +++ b/src/client/qwaylandinputdevice_p.h @@ -260,7 +260,29 @@ public: QList mPrevTouchPoints; }; - +class QWaylandPointerEvent +{ +public: + enum Type { + Enter, + Motion + }; + inline QWaylandPointerEvent(Type t, ulong ts, const QPointF &l, const QPointF &g, Qt::MouseButtons b, Qt::KeyboardModifiers m) + : type(t) + , timestamp(ts) + , local(l) + , global(g) + , buttons(b) + , modifiers(m) + {} + + Type type; + ulong timestamp; + QPointF local; + QPointF global; + Qt::MouseButtons buttons; + Qt::KeyboardModifiers modifiers; +}; QT_END_NAMESPACE -- cgit v1.2.3