From 7e5af3d2903e25404422b705837408ccd89c74b9 Mon Sep 17 00:00:00 2001 From: Johan Klokkahmmer Helsing Date: Thu, 29 Sep 2016 14:59:56 +0200 Subject: Compositor: Send touch events to the surface pressed This changes the API so that QWaylandTouch does not make assumptions about touch focus, and consequently enables writing compositors where multiple clients can receive touch input at the same time. Task-number: QTBUG-56237 Change-Id: I21fe6d9b5ac65e9f910f64cc4a02824119571c52 Reviewed-by: Nedim Hadzic Reviewed-by: Paul Olav Tvete --- src/compositor/compositor_api/qwaylandtouch_p.h | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'src/compositor/compositor_api/qwaylandtouch_p.h') diff --git a/src/compositor/compositor_api/qwaylandtouch_p.h b/src/compositor/compositor_api/qwaylandtouch_p.h index 35cd30502..75529134b 100644 --- a/src/compositor/compositor_api/qwaylandtouch_p.h +++ b/src/compositor/compositor_api/qwaylandtouch_p.h @@ -71,31 +71,14 @@ public: QWaylandCompositor *compositor() const { return seat->compositor(); } - uint sendDown(uint32_t time, int touch_id, const QPointF &position); - void sendMotion(uint32_t time, int touch_id, const QPointF &position); - uint sendUp(uint32_t time, int touch_id); + uint sendDown(QWaylandSurface *surface, uint32_t time, int touch_id, const QPointF &position); + void sendMotion(QWaylandClient *client, uint32_t time, int touch_id, const QPointF &position); + uint sendUp(QWaylandClient *client, uint32_t time, int touch_id); - void setFocusResource() - { - if (focusResource) - return; - - QWaylandView *mouseFocus = seat->mouseFocus(); - if (!mouseFocus || !mouseFocus->surface()) - return; - - focusResource = resourceMap().value(mouseFocus->surface()->waylandClient()); - } private: - void resetFocusState(); - void touch_bind_resource(Resource *resource) Q_DECL_OVERRIDE; - void touch_destroy_resource(Resource *resource) Q_DECL_OVERRIDE; void touch_release(Resource *resource) Q_DECL_OVERRIDE; QWaylandSeat *seat; - - Resource *focusResource; - QWaylandDestroyListener focusDestroyListener; }; QT_END_NAMESPACE -- cgit v1.2.3