Merge "TouchInputMapper: Use default viewport for PointerController" am: 69f1479abe
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1319647 Change-Id: I378e82dc2c6f1fe8506c7639f5c5244828589ea9
This commit is contained in:
commit
49990b462a
1 changed files with 5 additions and 1 deletions
|
@ -771,7 +771,11 @@ void TouchInputMapper::configureSurface(nsecs_t when, bool* outResetNeeded) {
|
|||
(mDeviceMode == DEVICE_MODE_DIRECT && mConfig.showTouches)) {
|
||||
if (mPointerController == nullptr || viewportChanged) {
|
||||
mPointerController = getPolicy()->obtainPointerController(getDeviceId());
|
||||
mPointerController->setDisplayViewport(mViewport);
|
||||
// Set the DisplayViewport for the PointerController to the default pointer display
|
||||
// that is recommended by the configuration before using it.
|
||||
std::optional<DisplayViewport> defaultViewport =
|
||||
mConfig.getDisplayViewportById(mConfig.defaultPointerDisplayId);
|
||||
mPointerController->setDisplayViewport(defaultViewport.value_or(mViewport));
|
||||
}
|
||||
} else {
|
||||
mPointerController.clear();
|
||||
|
|
Loading…
Reference in a new issue