diff --git a/frameworks/proxy/event_handler/src/input_manager_impl.cpp b/frameworks/proxy/event_handler/src/input_manager_impl.cpp index 00a25f609a4762b14f54d22bf3d81fd15ebceae5..304fbb8eadbb61a15d2dda9ae38865e499e6947f 100644 --- a/frameworks/proxy/event_handler/src/input_manager_impl.cpp +++ b/frameworks/proxy/event_handler/src/input_manager_impl.cpp @@ -1254,14 +1254,20 @@ void InputManagerImpl::OnConnected() template bool InputManagerImpl::RecoverPointerEvent(std::initializer_list pointerActionEvents, T pointerActionEvent) { + CALL_INFO_TRACE; CHKPF(lastPointerEvent_); int32_t pointerAction = lastPointerEvent_->GetPointerAction(); for (const auto &it : pointerActionEvents) { if (pointerAction == it) { - lastPointerEvent_->SetPointerAction(pointerActionEvent); PointerEvent::PointerItem item; + int32_t pointerId = lastPointerEvent_->GetPointerId(); + if (!lastPointerEvent_->GetPointerItem(pointerId, item)) { + MMI_HILOGE("Get pointer item failed. pointer:%{public}d", pointerId); + return false; + } item.SetPressed(false); - lastPointerEvent_->UpdatePointerItem(lastPointerEvent_->GetPointerId(), item); + lastPointerEvent_->UpdatePointerItem(pointerId, item); + lastPointerEvent_->SetPointerAction(pointerActionEvent); OnPointerEvent(lastPointerEvent_); return true; }