From 15060ed6b2a6e08a30b0040266041103942aa961 Mon Sep 17 00:00:00 2001 From: mayunteng_1 Date: Sat, 27 Apr 2024 10:05:19 +0000 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=A4=9A=E6=A8=A1=E8=BF=9B?= =?UTF-8?q?=E7=A8=8Bkill=E6=8E=89=E5=90=8E=E4=BA=8B=E4=BB=B6=E4=B8=8D?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: mayunteng_1 Change-Id: If34d935d9ba4150373515f4c892f4c2fdab8e27e --- .../proxy/event_handler/src/input_manager_impl.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frameworks/proxy/event_handler/src/input_manager_impl.cpp b/frameworks/proxy/event_handler/src/input_manager_impl.cpp index 00a25f609a..304fbb8ead 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; } -- Gitee