summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeff Brown <jeffbrown@google.com> 2010-09-27 16:35:11 -0700
committer Jeff Brown <jeffbrown@google.com> 2010-09-27 20:54:28 -0700
commit9a01d0519fa56fa75864cb96045c6ee832a39ff4 (patch)
tree96f85df7b4a0afc930d4ef348494c53a9c1b07f1
parent68ef7f3c3a8deb0e14b0b6325876b23cecc191b3 (diff)
Fix pointer index when splitting secondary pointers.
Change-Id: Ib01e810ea5b64501b1303000bbef0f0a1db2114e
-rw-r--r--libs/ui/InputDispatcher.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/ui/InputDispatcher.cpp b/libs/ui/InputDispatcher.cpp
index 5da16767599b..b5744b3e5eb5 100644
--- a/libs/ui/InputDispatcher.cpp
+++ b/libs/ui/InputDispatcher.cpp
@@ -1916,6 +1916,14 @@ InputDispatcher::splitMotionEvent(const MotionEntry* originalMotionEntry, BitSet
// The first/last pointer went down/up.
action = maskedAction == AMOTION_EVENT_ACTION_POINTER_DOWN
? AMOTION_EVENT_ACTION_DOWN : AMOTION_EVENT_ACTION_UP;
+ } else {
+ // A secondary pointer went down/up.
+ uint32_t splitPointerIndex = 0;
+ while (pointerId != splitPointerIds[splitPointerIndex]) {
+ splitPointerIndex += 1;
+ }
+ action = maskedAction | (splitPointerIndex
+ << AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT);
}
} else {
// An unrelated pointer changed.