summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandquickitem.cpp
diff options
context:
space:
mode:
authorJohan Klokkahmmer Helsing <johan.helsing@qt.io>2016-09-29 14:59:56 +0200
committerJohan Helsing <johan.helsing@qt.io>2016-10-03 13:49:53 +0000
commit7e5af3d2903e25404422b705837408ccd89c74b9 (patch)
treee453dac6b2265778f836026d202778e08195806e /src/compositor/compositor_api/qwaylandquickitem.cpp
parentdb9f2fc90ad1ae302846fa23d4955a8c07c444b7 (diff)
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 <nedim.hadzic@pelagicore.com> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/compositor/compositor_api/qwaylandquickitem.cpp')
-rw-r--r--src/compositor/compositor_api/qwaylandquickitem.cpp25
1 files changed, 1 insertions, 24 deletions
diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp
index f41a4c3ee..3e8d4b136 100644
--- a/src/compositor/compositor_api/qwaylandquickitem.cpp
+++ b/src/compositor/compositor_api/qwaylandquickitem.cpp
@@ -638,18 +638,6 @@ void QWaylandQuickItem::touchEvent(QTouchEvent *event)
if (d->shouldSendInputEvents() && d->touchEventsEnabled) {
QWaylandSeat *seat = compositor()->seatFor(event);
- if (event->type() == QEvent::TouchBegin) {
- QQuickItem *grabber = window()->mouseGrabberItem();
- if (grabber != this)
- grabMouse();
- }
-
- if (event->type() == QEvent::TouchEnd) {
- QQuickItem *grabber = window()->mouseGrabberItem();
- if (grabber == this)
- ungrabMouse();
- }
-
QPoint pointPos;
const QList<QTouchEvent::TouchPoint> &points = event->touchPoints();
if (!points.isEmpty())
@@ -664,23 +652,12 @@ void QWaylandQuickItem::touchEvent(QTouchEvent *event)
if (seat->mouseFocus() != d->view.data()) {
seat->sendMouseMoveEvent(d->view.data(), pointPos, mapToScene(pointPos));
}
- seat->sendFullTouchEvent(event);
+ seat->sendFullTouchEvent(surface(), event);
} else {
event->ignore();
}
}
-/*!
- * \internal
- */
-void QWaylandQuickItem::mouseUngrabEvent()
-{
- if (surface()) {
- QTouchEvent e(QEvent::TouchCancel);
- touchEvent(&e);
- }
-}
-
#ifndef QT_NO_IM
/*!
* \internal