@@ -194,6 +194,26 @@ void DirectionalDragArea::setImmediateRecognition(bool enabled)
194194 }
195195}
196196
197+bool DirectionalDragArea::monitorOnly() const
198+{
199+ return d->monitorOnly;
200+}
201+
202+void DirectionalDragArea::setMonitorOnly(bool monitorOnly)
203+{
204+ if (d->monitorOnly != monitorOnly) {
205+ d->monitorOnly = monitorOnly;
206+
207+ if (monitorOnly && d->status == DirectionalDragAreaPrivate::Undecided) {
208+ TouchRegistry::instance()->removeCandidateOwnerForTouch(d->touchId, this);
209+ // We still wanna know when it ends for keeping the composition time window up-to-date
210+ TouchRegistry::instance()->addTouchWatcher(d->touchId, this);
211+ }
212+
213+ Q_EMIT monitorOnlyChanged(monitorOnly);
214+ }
215+}
216+
197217void DirectionalDragArea::removeTimeConstraints()
198218{
199219 d->setMaxTime(60 * 60 * 1000);
@@ -260,7 +280,10 @@ void DirectionalDragAreaPrivate::unownedTouchEvent(UnownedTouchEvent *unownedTou
260280 unownedTouchEvent_undecided(unownedTouchEvent);
261281 break;
262282 default: // Recognized:
263− // do nothing
283+ if (monitorOnly) {
284+ // Treat unowned event as if we owned it, but we are really just watching it
285+ touchEvent_recognized(event);
286+ }
264287 break;
265288 }
266289
@@ -311,7 +334,9 @@ void DirectionalDragAreaPrivate::unownedTouchEvent_undecided(UnownedTouchEvent *
311334 }
312335
313336 if (movedFarEnoughAlongGestureAxis()) {
314− TouchRegistry::instance()->requestTouchOwnership(touchId, q);
337+ if (!monitorOnly) {
338+ TouchRegistry::instance()->requestTouchOwnership(touchId, q);
339+ }
315340 setStatus(Recognized);
316341 setPublicPos(touchPoint->pos());
317342 setPublicScenePos(touchScenePos);
@@ -411,12 +436,18 @@ void DirectionalDragAreaPrivate::touchEvent_absent(QTouchEvent *event)
411436 if (recognitionIsDisabled()) {
412437 // Behave like a dumb TouchArea
413438 ddaDebug("Gesture recognition is disabled. Requesting touch ownership immediately.");
414− TouchRegistry::instance()->requestTouchOwnership(touchId, q);
439+ if (!monitorOnly) {
440+ TouchRegistry::instance()->requestTouchOwnership(touchId, q);
441+ }
415442 setStatus(Recognized);
416443 event->accept();
417444 } else {
418445 // just monitor the touch points for now.
419− TouchRegistry::instance()->addCandidateOwnerForTouch(touchId, q);
446+ if (monitorOnly) {
447+ watchPressedTouchPoints(touchPoints);
448+ } else {
449+ TouchRegistry::instance()->addCandidateOwnerForTouch(touchId, q);
450+ }
420451
421452 setStatus(Undecided);
422453 // Let the item below have it. We will monitor it and grab it later if a gesture
@@ -884,5 +915,6 @@ DirectionalDragAreaPrivate::DirectionalDragAreaPrivate(DirectionalDragArea *q)
884915 , recognitionTimer(nullptr)
885916 , timeSource(new RealTimeSource)
886917 , activeTouches(timeSource)
918+ , monitorOnly(false)
887919{
888920}