aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickitem.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-05-07 14:56:26 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2018-05-15 13:19:40 +0000
commit710f9507c0ebf01d9e9f717e676b9c3b1b94ee8a (patch)
tree8d50c384e6d18b92612cacdaafd211de004a47a6 /src/quick/items/qquickitem.cpp
parentbe4c4877b35ad1b6983cf194e61f0dad1d123af5 (diff)
setGrabberItem: consistently call touchUngrabEvent or mouseUngrabEvent
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 <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/items/qquickitem.cpp')
-rw-r--r--src/quick/items/qquickitem.cpp5
1 files changed, 1 insertions, 4 deletions
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);
- }
}
/*!