summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandquickitem.cpp
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2017-01-10 12:26:26 +0100
committerJohan Helsing <johan.helsing@qt.io>2017-01-12 12:13:03 +0000
commitfd310aac0486ac26076e0aea87f6f8e0ed9aa542 (patch)
treeeac37cd2f53019f40bbeaf7e17f8160a4b00f55f /src/compositor/compositor_api/qwaylandquickitem.cpp
parent5e6259b09326022324709c44ad533d004056e048 (diff)
Send touch cancel event when QWaylandQuickItem::visible is set to false
Task-number: QTBUG-57927 Change-Id: I8b6a5aaa9337222286382ffbeee13b794bec125c Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/compositor/compositor_api/qwaylandquickitem.cpp')
-rw-r--r--src/compositor/compositor_api/qwaylandquickitem.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp
index 9ec000c84..dc7b6b067 100644
--- a/src/compositor/compositor_api/qwaylandquickitem.cpp
+++ b/src/compositor/compositor_api/qwaylandquickitem.cpp
@@ -660,6 +660,12 @@ void QWaylandQuickItem::touchEvent(QTouchEvent *event)
}
seat->sendFullTouchEvent(surface(), event);
+ if (event->type() == QEvent::TouchBegin) {
+ d->touchingSeats.append(seat);
+ } else if (event->type() == QEvent::TouchEnd || event->type() == QEvent::TouchCancel) {
+ d->touchingSeats.removeOne(seat);
+ }
+
if (event->type() == QEvent::TouchBegin && d->focusOnClick)
takeFocus(seat);
} else {
@@ -667,6 +673,14 @@ void QWaylandQuickItem::touchEvent(QTouchEvent *event)
}
}
+void QWaylandQuickItem::touchUngrabEvent()
+{
+ Q_D(QWaylandQuickItem);
+ for (auto seat : d->touchingSeats)
+ seat->sendTouchCancelEvent(surface()->client());
+ d->touchingSeats.clear();
+}
+
#if QT_CONFIG(im)
/*!
* \internal