Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 713bb3e5 authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

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
parent 3f90d316
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -2064,8 +2064,9 @@ InputEventInjectionResult InputDispatcher::findTouchedWindowTargetsLocked(
            }
        } 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 @@ InputEventInjectionResult InputDispatcher::findTouchedWindowTargetsLocked(

                // Make a slippery entrance into the new window.
                if (newTouchedWindowHandle->getInfo()->supportsSplitTouch()) {
                    isSplit = true;
                    isSplit = !isFromMouse;
                }

                int32_t targetFlags =