diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-06-20 14:43:08 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-07-11 10:07:01 +0000 |
commit | 46e0e527a50c9dc2bdc4f8eb21d1f4fec42ef6e8 (patch) | |
tree | 42e9384c2e66278393822678411568dc73487593 /src/quicktemplates2/qquickdrawer.cpp | |
parent | 38f7d855f2485cfb6a3a4328c1d31bac44ee0ae0 (diff) |
Don't be too eager to steal presses outside the drawer
While this is not a proper fix to the linked bug, debugging the issue revealed
that Drawer was way too eager to grab touch outside the drawer. It would not
do anything with the events until finger reached the drawer panel, so it's
completely unnecessary to steal the press far outside.
Change-Id: I76ff778b939327632cb29203db1c24e05c2a1a75
Task-number: QTBUG-53929
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickdrawer.cpp')
-rw-r--r-- | src/quicktemplates2/qquickdrawer.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickdrawer.cpp b/src/quicktemplates2/qquickdrawer.cpp index e5f356e4..0f45a96b 100644 --- a/src/quicktemplates2/qquickdrawer.cpp +++ b/src/quicktemplates2/qquickdrawer.cpp @@ -249,6 +249,14 @@ bool QQuickDrawerPrivate::handleMouseMoveEvent(QQuickItem *item, QMouseEvent *ev else overThreshold = dragOverThreshold(movePoint.y() - pressPoint.y(), Qt::YAxis, event, threshold); + // Don't be too eager to steal presses outside the drawer (QTBUG-53929) + if (overThreshold && qFuzzyCompare(position, qreal(1.0)) && !popupItem->contains(popupItem->mapFromScene(movePoint))) { + if (edge == Qt::LeftEdge || edge == Qt::RightEdge) + overThreshold = qAbs(movePoint.x() - q->width()) < dragMargin; + else + overThreshold = qAbs(movePoint.y() - q->height()) < dragMargin; + } + if (overThreshold) { QQuickItem *grabber = window->mouseGrabberItem(); if (!grabber || !grabber->keepMouseGrab()) { |