summaryrefslogtreecommitdiff
path: root/libs/input/TouchSpotController.cpp
diff options
context:
space:
mode:
author Linnan Li <lilinnan@xiaomi.corp-partner.google.com> 2023-11-24 13:05:13 +0800
committer Prabir Pradhan <prabirmsp@google.com> 2024-01-23 17:12:35 +0000
commit37c1b992d923106d79f4b299b2661a5fde0892cc (patch)
tree8f45ad7240fef82399fc6bb45542faa1ed572f3d /libs/input/TouchSpotController.cpp
parenta7bf350524587edf91394a00510dd189fcad17f2 (diff)
PointerController: Get initial DisplayInfos from SurfaceComposerClient
After the PointerController is created, if SurfaceFlinger hasn't called back to notify DisplayInfo,the PointerController won't have DisplayInfo, if the actual display exists and transforms at this time, using the display touch position will result in the wrong actual display position. Steps to reproduce the problem. 1. Switch the device to landscape. 2. Execute `adb shell settings put system show_touch 1`. 3. Touch the screen. 4. At this point, you can observe that the screen flashes an incorrect touch point location. How to fix it The addWindowInfosListener method has a parameter to get the initial position, which we use to get the current DisplayInfo at creation time. Even though this information would not exist if there were no other listeners, it doesn't matter here because the InputDispatcher was created long before the PointerController, and the InputDispatcher already added a listener, so the DisplayInfo information must exist, so we don't have to worry about this. Bug: 313033164 Test: Manual Change-Id: Ia942c85d1b2204690f69e6a2ba43cfb7542af27c Signed-off-by: Linnan Li <lilinnan@xiaomi.corp-partner.google.com>
Diffstat (limited to 'libs/input/TouchSpotController.cpp')
-rw-r--r--libs/input/TouchSpotController.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/input/TouchSpotController.cpp b/libs/input/TouchSpotController.cpp
index b8de919fbd8c..99952aa14904 100644
--- a/libs/input/TouchSpotController.cpp
+++ b/libs/input/TouchSpotController.cpp
@@ -93,7 +93,7 @@ void TouchSpotController::setSpots(const PointerCoords* spotCoords, const uint32
const PointerCoords& c = spotCoords[spotIdToIndex[id]];
ALOGD(" spot %d: position=(%0.3f, %0.3f), pressure=%0.3f, displayId=%" PRId32 ".", id,
c.getAxisValue(AMOTION_EVENT_AXIS_X), c.getAxisValue(AMOTION_EVENT_AXIS_Y),
- c.getAxisValue(AMOTION_EVENT_AXIS_PRESSURE), displayId);
+ c.getAxisValue(AMOTION_EVENT_AXIS_PRESSURE), mDisplayId);
}
#endif