From 49505ad3b93ab6280ebbf031c1f1793ffb8856a0 Mon Sep 17 00:00:00 2001 From: dreamond_wxy Date: Tue, 30 Apr 2024 14:36:11 +0800 Subject: [PATCH] multiple pointer stratefy modify Signed-off-by: dreamond_wxy --- .../event_dispatch/include/event_dispatch_handler.h | 3 +-- .../event_dispatch/src/event_dispatch_handler.cpp | 13 +++++-------- service/event_dispatch/test/event_dispatch_test.cpp | 3 ++- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/service/event_dispatch/include/event_dispatch_handler.h b/service/event_dispatch/include/event_dispatch_handler.h index 671317dda..1ace67292 100644 --- a/service/event_dispatch/include/event_dispatch_handler.h +++ b/service/event_dispatch/include/event_dispatch_handler.h @@ -52,7 +52,7 @@ public: #endif // OHOS_BUILD_ENABLE_KEYBOARD #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH) void HandlePointerEventInner(const std::shared_ptr point); - void NotifyPointerEventToRS(int32_t pointAction, const std::string& programName, uint32_t pid); + void NotifyPointerEventToRS(int32_t pointAction, const std::string& programName, uint32_t pid, int32_t pointCnt); #endif // OHOS_BUILD_ENABLE_POINTER || OHOS_BUILD_ENABLE_TOUCH private: @@ -62,7 +62,6 @@ private: int32_t eventTime_ { 0 }; int32_t currentTime_ { 0 }; - bool isTouchEnable_ = true; bool enableMark_ { true }; #if defined(OHOS_BUILD_ENABLE_POINTER) || defined(OHOS_BUILD_ENABLE_TOUCH) void FilterInvalidPointerItem(const std::shared_ptr pointEvent, int32_t fd); diff --git a/service/event_dispatch/src/event_dispatch_handler.cpp b/service/event_dispatch/src/event_dispatch_handler.cpp index c6a24a083..8a87f0ad9 100644 --- a/service/event_dispatch/src/event_dispatch_handler.cpp +++ b/service/event_dispatch/src/event_dispatch_handler.cpp @@ -127,14 +127,10 @@ void EventDispatchHandler::HandleMultiWindowPointerEvent(std::shared_ptr event) @@ -201,8 +197,9 @@ void EventDispatchHandler::DispatchPointerEventInner(std::shared_ptrGetPointerAction() == PointerEvent::POINTER_ACTION_UP || pointerEvent->GetPointerAction() == PointerEvent::POINTER_ACTION_PULL_DOWN || pointerEvent->GetPointerAction() == PointerEvent::POINTER_ACTION_PULL_UP) { + int32_t pointerCnt = pointerEvent->GetPointerCount(); NotifyPointerEventToRS(pointerEvent->GetPointerAction(), session->GetProgramName(), - static_cast(session->GetPid())); + static_cast(session->GetPid()), pointerCnt); } if (pointerEvent->GetPointerAction() != PointerEvent::POINTER_ACTION_MOVE) { MMI_HILOGI("InputTracking id:%{public}d, SendMsg to %{public}s:pid:%{public}d", diff --git a/service/event_dispatch/test/event_dispatch_test.cpp b/service/event_dispatch/test/event_dispatch_test.cpp index 09f018f9a..9dc71db12 100644 --- a/service/event_dispatch/test/event_dispatch_test.cpp +++ b/service/event_dispatch/test/event_dispatch_test.cpp @@ -71,7 +71,8 @@ HWTEST_F(EventDispatchTest, EventDispatchTest_NotifyPointerEventToRS_001, TestSi int32_t action = 1; std::string name = "ExampleProgram"; uint32_t processId = 12345; - ASSERT_NO_FATAL_FAILURE(eventdispatchhandler.NotifyPointerEventToRS(action, name, processId)); + int32_t touchCnt = 0; + ASSERT_NO_FATAL_FAILURE(eventdispatchhandler.NotifyPointerEventToRS(action, name, processId, touchCnt)); } /** -- Gitee