diff options
-rw-r--r-- | src/quicktemplates2/qquickdrawer.cpp | 10 | ||||
-rw-r--r-- | tests/auto/drawer/data/applicationwindow.qml | 7 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/quicktemplates2/qquickdrawer.cpp b/src/quicktemplates2/qquickdrawer.cpp index 0f45a96b..c165b077 100644 --- a/src/quicktemplates2/qquickdrawer.cpp +++ b/src/quicktemplates2/qquickdrawer.cpp @@ -244,10 +244,12 @@ bool QQuickDrawerPrivate::handleMouseMoveEvent(QQuickItem *item, QMouseEvent *ev // larger threshold to avoid being too eager to steal touch (QTBUG-50045) int threshold = qMax(20, QGuiApplication::styleHints()->startDragDistance() + 5); bool overThreshold = false; - if (edge == Qt::LeftEdge || edge == Qt::RightEdge) - overThreshold = dragOverThreshold(movePoint.x() - pressPoint.x(), Qt::XAxis, event, threshold); - else - overThreshold = dragOverThreshold(movePoint.y() - pressPoint.y(), Qt::YAxis, event, threshold); + if (position > 0 || dragMargin > 0) { + if (edge == Qt::LeftEdge || edge == Qt::RightEdge) + overThreshold = dragOverThreshold(movePoint.x() - pressPoint.x(), Qt::XAxis, event, threshold); + 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))) { diff --git a/tests/auto/drawer/data/applicationwindow.qml b/tests/auto/drawer/data/applicationwindow.qml index 9032ea0d..a8ae69ed 100644 --- a/tests/auto/drawer/data/applicationwindow.qml +++ b/tests/auto/drawer/data/applicationwindow.qml @@ -51,5 +51,12 @@ ApplicationWindow { id: drawer width: 200 height: 200 + + MouseArea { + // QTBUG-54629 + anchors.fill: parent + anchors.margins: -Qt.styleHints.startDragDistance + Rectangle { color: "red"; opacity: 0.25; anchors.fill: parent } + } } } |