From 0aea009425242417bffdb171c8eca02ff52f4a7b Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Thu, 10 Mar 2016 13:28:06 +1000 Subject: Fix Flickable state being reset when it replays a delayed press. Ignore mouseUngrabEvents() triggered by giving mouse grab to a child item when replaying a delayed press event. Change-Id: I6c8db61167e21bf10d533b17f7cc65e4754bd432 Reviewed-by: Shawn Rutledge Reviewed-by: Martin Jones --- src/quick/items/qquickflickable.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index 870a0268e1..c838eae3c7 100644 --- a/src/quick/items/qquickflickable.cpp +++ b/src/quick/items/qquickflickable.cpp @@ -1539,11 +1539,11 @@ void QQuickFlickablePrivate::replayDelayedPress() // If we have the grab, release before delivering the event if (QQuickWindow *w = q->window()) { + replayingPressEvent = true; if (w->mouseGrabberItem() == q) q->ungrabMouse(); // Use the event handler that will take care of finding the proper item to propagate the event - replayingPressEvent = true; QCoreApplication::sendEvent(w, mouseEvent.data()); replayingPressEvent = false; } @@ -2199,7 +2199,8 @@ void QQuickFlickable::mouseUngrabEvent() Q_D(QQuickFlickable); // if our mouse grab has been removed (probably by another Flickable), // fix our state - d->cancelInteraction(); + if (!d->replayingPressEvent) + d->cancelInteraction(); } void QQuickFlickablePrivate::cancelInteraction() -- cgit v1.2.3