From 710f9507c0ebf01d9e9f717e676b9c3b1b94ee8a Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Mon, 7 May 2018 14:56:26 +0200 Subject: setGrabberItem: consistently call touchUngrabEvent or mouseUngrabEvent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Calling grabberItem() to get the old grabber must come before setting m_exclusiveGrabber. Then we call oldGrabberItem->touchUngrabEvent() or oldGrabberItem->mouseUngrabEvent() as appropriate. Now the responsibility for this is moved from QQuickItem::grabMouse() to QQuickEventPoint::setGrabberItem() (which it calls). Task-number: QTBUG-65648 Change-Id: Ia6219cb798d7f671ccc4006d51eeb87dbdbda3ef Reviewed-by: Jan Arve Sæther --- src/quick/items/qquickitem.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/quick/items/qquickitem.cpp') diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 3d650bf223..70bb7db2b0 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -7462,11 +7462,8 @@ void QQuickItem::grabMouse() auto point = fromTouch ? windowPriv->pointerEventInstance(windowPriv->touchMouseDevice)->pointById(windowPriv->touchMouseId) : windowPriv->pointerEventInstance(QQuickPointerDevice::genericMouseDevice())->point(0); - if (point) { - QQuickItem *oldGrabber = point->grabberItem(); + if (point) point->setGrabberItem(this); - windowPriv->sendUngrabEvent(oldGrabber, fromTouch); - } } /*! -- cgit v1.2.3