From fb15206453faa8db26feb197dac3d16a8d6dfa1b Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Tue, 21 Jun 2016 13:40:15 +0200 Subject: ungrab touch points if the MultiPointTouchArea is hidden or disabled This caused MPTA to not emit onCanceled and caused the touch points 'pressed' property to not become 'false' after the MPTA was hidden or disabled. We now ungrab the touch points where we already ungrabbed the mouse. Change-Id: I90a5d4fa4b3fa470b8b60881c80418e79061f001 Task-number: QTBUG-42928 Reviewed-by: Shawn Rutledge --- src/quick/items/qquickitem.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/quick/items/qquickitem.cpp') diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index d0f5f162fc..1c7a556540 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -5715,6 +5715,8 @@ bool QQuickItemPrivate::setEffectiveVisibleRecur(bool newEffectiveVisible) QQuickWindowPrivate *windowPriv = QQuickWindowPrivate::get(window); if (windowPriv->mouseGrabberItem == q) q->ungrabMouse(); + if (!effectiveVisible) + q->ungrabTouchPoints(); } bool childVisibilityChanged = false; @@ -5763,6 +5765,8 @@ void QQuickItemPrivate::setEffectiveEnableRecur(QQuickItem *scope, bool newEffec QQuickWindowPrivate *windowPriv = QQuickWindowPrivate::get(window); if (windowPriv->mouseGrabberItem == q) q->ungrabMouse(); + if (!effectiveEnable) + q->ungrabTouchPoints(); if (scope && !effectiveEnable && activeFocus) { windowPriv->clearFocusInScope( scope, q, Qt::OtherFocusReason, QQuickWindowPrivate::DontChangeFocusProperty | QQuickWindowPrivate::DontChangeSubFocusItem); -- cgit v1.2.3