summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qgesturemanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qgesturemanager.cpp')
-rw-r--r--src/gui/kernel/qgesturemanager.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp
index 43facef..e43a560 100644
--- a/src/gui/kernel/qgesturemanager.cpp
+++ b/src/gui/kernel/qgesturemanager.cpp
@@ -66,6 +66,8 @@
# define DEBUG qDebug
#endif
+#ifndef QT_NO_GESTURES
+
QT_BEGIN_NAMESPACE
QGestureManager::QGestureManager(QObject *parent)
@@ -284,6 +286,9 @@ bool QGestureManager::filterEventThroughContexts(const QMultiMap<QObject *,
// check if a running gesture switched back to maybe state
QSet<QGesture *> activeToMaybeGestures = m_activeGestures & newMaybeGestures;
+ // check if a maybe gesture switched to canceled - reset it but don't send an event
+ QSet<QGesture *> maybeToCanceledGestures = m_maybeGestures & notGestures;
+
// check if a running gesture switched back to not gesture state,
// i.e. were canceled
QSet<QGesture *> canceledGestures = m_activeGestures & notGestures;
@@ -343,7 +348,8 @@ bool QGestureManager::filterEventThroughContexts(const QMultiMap<QObject *,
<< "\n\tstarted:" << startedGestures
<< "\n\ttriggered:" << triggeredGestures
<< "\n\tfinished:" << finishedGestures
- << "\n\tcanceled:" << canceledGestures;
+ << "\n\tcanceled:" << canceledGestures
+ << "\n\tmaybe-canceled:" << maybeToCanceledGestures;
}
QSet<QGesture *> undeliveredGestures;
@@ -364,7 +370,7 @@ bool QGestureManager::filterEventThroughContexts(const QMultiMap<QObject *,
// reset gestures that ended
QSet<QGesture *> endedGestures =
- finishedGestures + canceledGestures + undeliveredGestures;
+ finishedGestures + canceledGestures + undeliveredGestures + maybeToCanceledGestures;
foreach (QGesture *gesture, endedGestures) {
recycle(gesture);
m_gestureTargets.remove(gesture);
@@ -684,6 +690,7 @@ void QGestureManager::recycle(QGesture *gesture)
if (recognizer) {
gesture->setGestureCancelPolicy(QGesture::CancelNone);
recognizer->reset(gesture);
+ m_activeGestures.remove(gesture);
} else {
cleanupGesturesForRemovedRecognizer(gesture);
}
@@ -691,4 +698,6 @@ void QGestureManager::recycle(QGesture *gesture)
QT_END_NAMESPACE
+#endif // QT_NO_GESTURES
+
#include "moc_qgesturemanager_p.cpp"