diff options
Diffstat (limited to 'src/compositor/compositor_api/qwaylandquickitem.cpp')
-rw-r--r-- | src/compositor/compositor_api/qwaylandquickitem.cpp | 14 |
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 |