InputDispatcher: Don't split mouse events
Events coming from a mouse should never be split, and should always be
dispatched to the mouse cursor position, even if it has muliple
pointers.
Bug: None
Test: atest inputflinger_tests
Change-Id: I53c7d59df54eabf89017c4a4e39a26e81951c344
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp
index d6ae3cd..f50c9e1 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.cpp
+++ b/services/inputflinger/dispatcher/InputDispatcher.cpp
@@ -2064,8 +2064,9 @@
}
} else {
// No window is touched, so set split to true. This will allow the next pointer down to
- // be delivered to a new window which supports split touch.
- tempTouchState.split = isSplit = true;
+ // be delivered to a new window which supports split touch. Pointers from a mouse device
+ // should never be split.
+ tempTouchState.split = isSplit = !isFromMouse;
}
// Update hover state.
@@ -2211,7 +2212,7 @@
// Make a slippery entrance into the new window.
if (newTouchedWindowHandle->getInfo()->supportsSplitTouch()) {
- isSplit = true;
+ isSplit = !isFromMouse;
}
int32_t targetFlags =