From 46e0e527a50c9dc2bdc4f8eb21d1f4fec42ef6e8 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 20 Jun 2016 14:43:08 +0200 Subject: 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 --- src/quicktemplates2/qquickdrawer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/quicktemplates2/qquickdrawer.cpp') 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()) { -- cgit v1.2.3