From d546c56eed44c0e7ef377af99848e10cf8b2bfcf Mon Sep 17 00:00:00 2001 From: peng Date: Tue, 6 Feb 2024 21:16:26 +0800 Subject: [PATCH] fix outside down event bug and improve performance Signed-off-by: peng --- .../intention_event/src/intention_event_manager.cpp | 5 ++++- wm/src/window_scene_session_impl.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/window_scene/intention_event/src/intention_event_manager.cpp b/window_scene/intention_event/src/intention_event_manager.cpp index 86158334db..8ecc79ff56 100644 --- a/window_scene/intention_event/src/intention_event_manager.cpp +++ b/window_scene/intention_event/src/intention_event_manager.cpp @@ -215,6 +215,9 @@ void IntentionEventManager::InputEventListener::OnInputEvent( } else { // transfer pointer event for move and drag WSError ret = sceneSession->TransferPointerEvent(pointerEvent); + if (sceneSession->GetWindowType() == WindowType::WINDOW_TYPE_SYSTEM_FLOAT) { + sceneSession->NotifyOutsideDownEvent(pointerEvent); + } if (ret != WSError::WS_OK && pointerEvent != nullptr) { pointerEvent->MarkProcessed(); } @@ -339,4 +342,4 @@ void IntentionEventManager::InputEventListener::OnInputEvent( } } } -} // namespace OHOS::Rosen \ No newline at end of file +} // namespace OHOS::Rosen diff --git a/wm/src/window_scene_session_impl.cpp b/wm/src/window_scene_session_impl.cpp index ac9a50b4f4..20aa54b489 100644 --- a/wm/src/window_scene_session_impl.cpp +++ b/wm/src/window_scene_session_impl.cpp @@ -25,6 +25,7 @@ #include "display_info.h" #include "singleton_container.h" #include "display_manager.h" +#include "display_manager_adapter.h" #include "input_transfer_station.h" #include "perform_reporter.h" #include "session_helper.h" @@ -405,13 +406,13 @@ void WindowSceneSessionImpl::ConsumePointerEventInner(const std::shared_ptr().GetDisplayById(property_->GetDisplayId()); - if (display == nullptr || display->GetDisplayInfo() == nullptr) { + auto displayInfo = SingletonContainer::Get().GetDisplayInfo(property_->GetDisplayId()); + if (displayInfo == nullptr) { WLOGFE("The display or display info is nullptr"); pointerEvent->MarkProcessed(); return; } - float vpr = display->GetDisplayInfo()->GetVirtualPixelRatio(); + float vpr = displayInfo->GetVirtualPixelRatio(); if (MathHelper::NearZero(vpr)) { WLOGFW("vpr is zero"); pointerEvent->MarkProcessed(); -- Gitee