diff options
author | 2023-10-30 17:41:28 +0900 | |
---|---|---|
committer | 2023-11-08 20:29:42 +0000 | |
commit | 49f94b5919de0db0ada4e81f93219e8d4ffa95c6 (patch) | |
tree | 70ed55b28c5002f1f181fb992e4b754f53be2461 | |
parent | 08daa25989491352b08ee10a33fae530b3bed12e (diff) |
Modify getPosition of disabled PointerController
PointerChoreographer has to combine fake finger coordinates with
the position of MousePointerController to process some touchpad
events.
The legacy PointerController which is disabled should return
(0, 0) instead of (nan, nan) on getPosition, so that
GestureConverter can set x-y axes correctly.
Test: atest libinputservice_test
Bug: 293587049
Change-Id: I7630cd16defc9324970f0c29851c80f1b9943977
-rw-r--r-- | libs/input/PointerController.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libs/input/PointerController.cpp b/libs/input/PointerController.cpp index 972e16841f49..2e7452d780eb 100644 --- a/libs/input/PointerController.cpp +++ b/libs/input/PointerController.cpp @@ -175,8 +175,7 @@ void PointerController::setPosition(float x, float y) { FloatPoint PointerController::getPosition() const { if (!mEnabled) { - return FloatPoint{AMOTION_EVENT_INVALID_CURSOR_POSITION, - AMOTION_EVENT_INVALID_CURSOR_POSITION}; + return FloatPoint{0, 0}; } const int32_t displayId = mCursorController.getDisplayId(); |