From 583d44380bccba4e1fa22595d390cb2c9c57ac7e Mon Sep 17 00:00:00 2001 From: l00574490 Date: Thu, 14 Jul 2022 16:47:59 +0800 Subject: [PATCH] add vsync interface Signed-off-by: l00574490 Change-Id: I66b20e3148ddc2bab00b38b8a0e1d0f37e6764f3 --- interfaces/innerkits/wm/window.h | 2 + interfaces/innerkits/wm/window_option.h | 3 ++ interfaces/innerkits/wm/wm_common.h | 5 --- wm/include/input_transfer_station.h | 3 ++ wm/include/vsync_station.h | 28 ++++++++------ wm/include/window_impl.h | 3 ++ wm/include/window_input_channel.h | 3 -- wm/src/input_transfer_station.cpp | 26 +++++++++++-- wm/src/vsync_station.cpp | 51 ++++++++++--------------- wm/src/window_impl.cpp | 18 ++++++++- wm/src/window_input_channel.cpp | 49 ++---------------------- wm/src/window_option.cpp | 10 +++++ wmserver/include/drag_controller.h | 1 - wmserver/src/drag_controller.cpp | 30 ++++----------- 14 files changed, 109 insertions(+), 123 deletions(-) diff --git a/interfaces/innerkits/wm/window.h b/interfaces/innerkits/wm/window.h index 620a76b1..98241dd1 100644 --- a/interfaces/innerkits/wm/window.h +++ b/interfaces/innerkits/wm/window.h @@ -349,6 +349,7 @@ public: virtual void SetInputEventConsumer(const std::shared_ptr& inputEventConsumer) = 0; virtual void ConsumeKeyEvent(std::shared_ptr& inputEvent) = 0; virtual void ConsumePointerEvent(const std::shared_ptr& inputEvent) = 0; + virtual void RequestVsync(const std::shared_ptr& vsyncCallback) = 0; virtual void UpdateConfiguration(const std::shared_ptr& configuration) = 0; /** * @brief register window lifecycle listener. @@ -400,6 +401,7 @@ public: virtual uint32_t GetRequestModeSupportInfo() const = 0; virtual WMError SetTouchHotAreas(const std::vector& rects) = 0; virtual void GetRequestedTouchHotAreas(std::vector& rects) const = 0; + virtual bool IsMainHandlerAvailable() const = 0; /** * @brief disable main window decoration. It must be callled before loadContent. diff --git a/interfaces/innerkits/wm/window_option.h b/interfaces/innerkits/wm/window_option.h index 08360aa0..44299555 100644 --- a/interfaces/innerkits/wm/window_option.h +++ b/interfaces/innerkits/wm/window_option.h @@ -50,6 +50,7 @@ public: void SetBrightness(float brightness); void SetRequestedOrientation(Orientation orientation); void SetCallingWindow(uint32_t windowId); + void SetMainHandlerAvailable(bool isMainHandlerAvailable); Rect GetWindowRect() const; WindowType GetWindowType() const; @@ -66,6 +67,7 @@ public: float GetBrightness() const; Orientation GetRequestedOrientation() const; uint32_t GetCallingWindow() const; + bool GetMainHandlerAvailable() const; private: Rect windowRect_ { 0, 0, 0, 0 }; @@ -81,6 +83,7 @@ private: WindowTag windowTag_; bool keepScreenOn_ = false; bool turnScreenOn_ = false; + bool isMainHandlerAvailable_ = true; float brightness_ = UNDEFINED_BRIGHTNESS; uint32_t callingWindow_ = INVALID_WINDOW_ID; std::unordered_map sysBarPropMap_ { diff --git a/interfaces/innerkits/wm/wm_common.h b/interfaces/innerkits/wm/wm_common.h index 31e302da..640992d3 100644 --- a/interfaces/innerkits/wm/wm_common.h +++ b/interfaces/innerkits/wm/wm_common.h @@ -362,11 +362,6 @@ struct SystemConfig { bool isStretchable_ = false; }; -enum class CallbackType { - CALLBACK_INPUT = 0, - CALLBACK_FRAME = 1, -}; - using OnCallback = std::function; struct VsyncCallback { OnCallback onCallback; diff --git a/wm/include/input_transfer_station.h b/wm/include/input_transfer_station.h index f8d1e552..5d4634e0 100644 --- a/wm/include/input_transfer_station.h +++ b/wm/include/input_transfer_station.h @@ -36,9 +36,12 @@ public: private: sptr GetInputChannel(uint32_t windowId); + std::mutex mtx_; std::unordered_map> windowInputChannels_; std::shared_ptr inputListener_ = nullptr; + std::shared_ptr eventHandler_ = nullptr; + const std::string INPUT_AND_VSYNC_THREAD = "input_and_vsync_thread"; }; class InputEventListener : public MMI::IInputEventConsumer { diff --git a/wm/include/vsync_station.h b/wm/include/vsync_station.h index 8d33cefe..075b4b3d 100644 --- a/wm/include/vsync_station.h +++ b/wm/include/vsync_station.h @@ -35,34 +35,38 @@ class VsyncStation { WM_DECLARE_SINGLE_INSTANCE_BASE(VsyncStation); public: ~VsyncStation() = default; - void RequestVsync(CallbackType type, const std::shared_ptr& vsyncCallback); - void RemoveCallback(CallbackType type, const std::shared_ptr& vsyncCallback); + void RequestVsync(const std::shared_ptr& vsyncCallback); + void RemoveCallback(); void SetIsMainHandlerAvailable(bool available) { isMainHandlerAvailable_ = available; } + void SetVsyncEventHandler(const std::shared_ptr& eventHandler) + { + vsyncHandler_ = eventHandler; + } + private: VsyncStation() = default; static void OnVsync(int64_t nanoTimestamp, void* client); void VsyncCallbackInner(int64_t nanoTimestamp); void OnVsyncTimeOut(); - AppExecFwk::EventHandler::Callback vsyncTimeoutCallback_ = std::bind(&VsyncStation::OnVsyncTimeOut, this); - const std::string VSYNC_THREAD_ID = "vsync_thread"; - std::shared_ptr vsyncHandler_ = nullptr; + std::mutex mtx_; - bool hasRequestedVsync_ = false; - bool isMainHandlerAvailable_ = false; uint32_t vsyncCount_ = 0; - std::map>> vsyncCallbacks_ = { - {CallbackType::CALLBACK_INPUT, {}}, - {CallbackType::CALLBACK_FRAME, {}}, - }; + bool hasRequestedVsync_ = false; + bool hasInitVsyncReceiver_ = false; + bool isMainHandlerAvailable_ = true; + const std::string VSYNC_THREAD_ID = "vsync_thread"; + std::shared_ptr receiver_ = nullptr; + std::unordered_set> vsyncCallbacks_; VSyncReceiver::FrameCallback frameCallback_ = { .userData_ = this, .callback_ = OnVsync, }; - std::shared_ptr receiver_ = nullptr; + std::shared_ptr vsyncHandler_ = nullptr; + AppExecFwk::EventHandler::Callback vsyncTimeoutCallback_ = std::bind(&VsyncStation::OnVsyncTimeOut, this); }; } // namespace Rosen } // namespace OHOS diff --git a/wm/include/window_impl.h b/wm/include/window_impl.h index 605775d7..aefff880 100644 --- a/wm/include/window_impl.h +++ b/wm/include/window_impl.h @@ -117,6 +117,7 @@ public: virtual uint32_t GetWindowId() const override; virtual uint32_t GetWindowFlags() const override; uint32_t GetRequestModeSupportInfo() const override; + bool IsMainHandlerAvailable() const override; inline NotifyNativeWinDestroyFunc GetNativeDestroyCallback() { return notifyNativefunc_; @@ -214,6 +215,7 @@ public: void UpdateModeSupportInfo(uint32_t modeSupportInfo); virtual void ConsumeKeyEvent(std::shared_ptr& inputEvent) override; virtual void ConsumePointerEvent(const std::shared_ptr& inputEvent) override; + virtual void RequestVsync(const std::shared_ptr& vsyncCallback) override; void UpdateFocusStatus(bool focused); virtual void UpdateConfiguration(const std::shared_ptr& configuration) override; void UpdateAvoidArea(const sptr& avoidArea, AvoidAreaType type); @@ -436,6 +438,7 @@ private: bool isOriginRectSet_ = false; bool needRemoveWindowInputChannel_ = false; bool isListenerHandlerRunning_ = false; + bool isMainHandlerAvailable_ = true; }; } // namespace Rosen } // namespace OHOS diff --git a/wm/include/window_input_channel.h b/wm/include/window_input_channel.h index 8a6498ea..ed085e9b 100644 --- a/wm/include/window_input_channel.h +++ b/wm/include/window_input_channel.h @@ -31,13 +31,10 @@ public: void HandleKeyEvent(std::shared_ptr& keyEvent); void Destroy(); private: - void OnVsync(int64_t timeStamp); bool IsKeyboardEvent(const std::shared_ptr& keyEvent) const; - std::shared_ptr moveEvent_ = nullptr; std::mutex mtx_; sptr window_; bool isAvailable_; - std::shared_ptr callback_ = std::make_shared(VsyncCallback()); static const int32_t MAX_INPUT_NUM = 100; }; } diff --git a/wm/src/input_transfer_station.cpp b/wm/src/input_transfer_station.cpp index 3a67af2b..d7127df8 100644 --- a/wm/src/input_transfer_station.cpp +++ b/wm/src/input_transfer_station.cpp @@ -14,7 +14,11 @@ */ #include "input_transfer_station.h" -#include + +#include +#include +#include "vsync_station.h" +#include "window_manager_hilog.h" namespace OHOS { namespace Rosen { @@ -77,9 +81,25 @@ void InputTransferStation::AddInputWindow(const sptr& window) std::lock_guard lock(mtx_); windowInputChannels_.insert(std::make_pair(windowId, inputChannel)); if (inputListener_ == nullptr) { - WLOGFI("Init input listener"); + WLOGFI("Init input listener, IsMainHandlerAvailable: %{public}u", window->IsMainHandlerAvailable()); std::shared_ptr listener = std::make_shared(InputEventListener()); - MMI::InputManager::GetInstance()->SetWindowInputEventConsumer(listener); + auto mainEventRunner = AppExecFwk::EventRunner::GetMainEventRunner(); + if (mainEventRunner != nullptr && window->IsMainHandlerAvailable()) { + WLOGFI("MainEventRunner is available"); + eventHandler_ = std::make_shared(mainEventRunner); + MMI::InputManager::GetInstance()->SetWindowInputEventConsumer(listener, eventHandler_); + } else { + WLOGFI("MainEventRunner is not available"); + eventHandler_ = AppExecFwk::EventHandler::Current(); + auto curThreadId = std::this_thread::get_id(); + if (!eventHandler_ || (mainEventRunner->GetThreadId() == *(reinterpret_cast(&curThreadId)))) { + eventHandler_ = std::make_shared( + AppExecFwk::EventRunner::Create(INPUT_AND_VSYNC_THREAD)); + } + MMI::InputManager::GetInstance()->SetWindowInputEventConsumer(listener, eventHandler_); + VsyncStation::GetInstance().SetIsMainHandlerAvailable(false); + VsyncStation::GetInstance().SetVsyncEventHandler(eventHandler_); + } inputListener_ = listener; } } diff --git a/wm/src/vsync_station.cpp b/wm/src/vsync_station.cpp index d4fe8199..9efc9002 100644 --- a/wm/src/vsync_station.cpp +++ b/wm/src/vsync_station.cpp @@ -14,6 +14,7 @@ */ #include "vsync_station.h" + #include "transaction/rs_interfaces.h" #include "window_manager_hilog.h" @@ -26,31 +27,30 @@ namespace { } WM_IMPLEMENT_SINGLE_INSTANCE(VsyncStation) -void VsyncStation::RequestVsync(CallbackType type, const std::shared_ptr& vsyncCallback) +void VsyncStation::RequestVsync(const std::shared_ptr& vsyncCallback) { { std::lock_guard lock(mtx_); - auto iter = vsyncCallbacks_.find(type); - if (iter == vsyncCallbacks_.end()) { - WLOGFE("wrong callback type."); - return; - } - iter->second.insert(vsyncCallback); + vsyncCallbacks_.insert(vsyncCallback); - if (vsyncHandler_ == nullptr) { + if (!hasInitVsyncReceiver_ || !vsyncHandler_) { auto mainEventRunner = AppExecFwk::EventRunner::GetMainEventRunner(); if (mainEventRunner != nullptr && isMainHandlerAvailable_) { + WLOGFI("MainEventRunner is available"); vsyncHandler_ = std::make_shared(mainEventRunner); } else { - WLOGFE("MainEventRunner is not available, create a new EventRunner for vsyncHandler_."); - vsyncHandler_ = std::make_shared( - AppExecFwk::EventRunner::Create(VSYNC_THREAD_ID)); + WLOGFI("MainEventRunner is not available"); + if (!vsyncHandler_) { + vsyncHandler_ = std::make_shared( + AppExecFwk::EventRunner::Create(VSYNC_THREAD_ID)); + } } auto& rsClient = OHOS::Rosen::RSInterfaces::GetInstance(); while (receiver_ == nullptr) { receiver_ = rsClient.CreateVSyncReceiver("WM_" + std::to_string(::getpid()), vsyncHandler_); } receiver_->Init(); + hasInitVsyncReceiver_ = true; } if (hasRequestedVsync_) { return; @@ -58,7 +58,7 @@ void VsyncStation::RequestVsync(CallbackType type, const std::shared_ptrRemoveTask(VSYNC_TIME_OUT_TASK); vsyncHandler_->PostTask(vsyncTimeoutCallback_, VSYNC_TIME_OUT_TASK, VSYNC_TIME_OUT_MILLISECONDS); @@ -66,37 +66,28 @@ void VsyncStation::RequestVsync(CallbackType type, const std::shared_ptrRequestNextVSync(frameCallback_); } -void VsyncStation::RemoveCallback(CallbackType type, const std::shared_ptr& vsyncCallback) +void VsyncStation::RemoveCallback() { - WLOGFI("Remove callback, type: %{public}u", type); std::lock_guard lock(mtx_); - auto iter = vsyncCallbacks_.find(type); - if (iter == vsyncCallbacks_.end()) { - WLOGFE("wrong callback type."); - return; - } - iter->second.erase(vsyncCallback); + WLOGFI("[WM] Remove Vsync callback"); + vsyncCallbacks_.clear(); } void VsyncStation::VsyncCallbackInner(int64_t timestamp) { - std::map>> vsyncCallbacks; + std::unordered_set> vsyncCallbacks; { std::lock_guard lock(mtx_); hasRequestedVsync_ = false; vsyncCallbacks = vsyncCallbacks_; - for (auto& vsyncCallbacksSet: vsyncCallbacks_) { - vsyncCallbacksSet.second.clear(); - } + vsyncCallbacks_.clear(); vsyncHandler_->RemoveTask(VSYNC_TIME_OUT_TASK); if (vsyncCount_ & 0x01) { // write log every 2 vsync - WLOGFI("On vsync callback."); + WLOGFD("[WM] On vsync callback."); } } - for (auto& vsyncCallbacksSet: vsyncCallbacks) { - for (const auto& callback: vsyncCallbacksSet.second) { - callback->onCallback(timestamp); - } + for (const auto& callback: vsyncCallbacks) { + callback->onCallback(timestamp); } } @@ -112,8 +103,8 @@ void VsyncStation::OnVsync(int64_t timestamp, void* client) void VsyncStation::OnVsyncTimeOut() { - WLOGFE("Vsync time out"); std::lock_guard lock(mtx_); + WLOGFI("[WM] Vsync time out"); hasRequestedVsync_ = false; } } diff --git a/wm/src/window_impl.cpp b/wm/src/window_impl.cpp index 75d69724..47c3ad77 100755 --- a/wm/src/window_impl.cpp +++ b/wm/src/window_impl.cpp @@ -70,6 +70,7 @@ WindowImpl::WindowImpl(const sptr& option) property_->SetHitOffset(option->GetHitOffset()); property_->SetRequestedOrientation(option->GetRequestedOrientation()); windowTag_ = option->GetWindowTag(); + isMainHandlerAvailable_ = option->GetMainHandlerAvailable(); property_->SetTurnScreenOn(option->IsTurnScreenOn()); property_->SetKeepScreenOn(option->IsKeepScreenOn()); property_->SetBrightness(option->GetBrightness()); @@ -300,6 +301,11 @@ uint32_t WindowImpl::GetModeSupportInfo() const return property_->GetModeSupportInfo(); } +bool WindowImpl::IsMainHandlerAvailable() const +{ + return isMainHandlerAvailable_; +} + SystemBarProperty WindowImpl::GetSystemBarPropertyByType(WindowType type) const { auto curProperties = property_->GetSystemBarProperty(); @@ -2280,11 +2286,21 @@ void WindowImpl::ConsumePointerEvent(const std::shared_ptr& p WLOGFI("Transfer pointer event to uiContent"); (void)uiContent_->ProcessPointerEvent(pointerEvent); } else { - WLOGW("pointerEvent is not consumed, windowId: %{public}u", GetWindowId()); + WLOGE("pointerEvent is not consumed, windowId: %{public}u", GetWindowId()); pointerEvent->MarkProcessed(); } } +void WindowImpl::RequestVsync(const std::shared_ptr& vsyncCallback) +{ + std::lock_guard lock(mutex_); + if (state_ == WindowState::STATE_DESTROYED) { + WLOGFE("[WM] Receive Vsync Request failed, window is destroyed"); + return; + } + VsyncStation::GetInstance().RequestVsync(vsyncCallback); +} + void WindowImpl::UpdateFocusStatus(bool focused) { WLOGFI("window focus status: %{public}d, id: %{public}u", focused, property_->GetWindowId()); diff --git a/wm/src/window_input_channel.cpp b/wm/src/window_input_channel.cpp index 2877fe1a..2f28cab5 100644 --- a/wm/src/window_input_channel.cpp +++ b/wm/src/window_input_channel.cpp @@ -24,7 +24,6 @@ namespace { } WindowInputChannel::WindowInputChannel(const sptr& window): window_(window), isAvailable_(true) { - callback_->onCallback = std::bind(&WindowInputChannel::OnVsync, this, std::placeholders::_1); } WindowInputChannel::~WindowInputChannel() @@ -66,6 +65,8 @@ void WindowInputChannel::HandlePointerEvent(std::shared_ptr& WLOGFE("pointerEvent is nullptr"); return; } + WLOGFI("Receive pointer event, windowId: %{public}u, action: %{public}d", + window_->GetWindowId(), pointerEvent->GetPointerAction()); if ((window_->GetType() == WindowType::WINDOW_TYPE_DIALOG) && (pointerEvent->GetAgentWindowId() != pointerEvent->GetTargetWindowId())) { if (pointerEvent->GetPointerAction() == MMI::PointerEvent::POINTER_ACTION_DOWN || @@ -75,46 +76,6 @@ void WindowInputChannel::HandlePointerEvent(std::shared_ptr& pointerEvent->MarkProcessed(); return; } - if (pointerEvent->GetPointerAction() == MMI::PointerEvent::POINTER_ACTION_MOVE) { - std::shared_ptr pointerEventTemp; - { - std::lock_guard lock(mtx_); - pointerEventTemp = moveEvent_; - moveEvent_ = pointerEvent; - if (isAvailable_) { - VsyncStation::GetInstance().RequestVsync(CallbackType::CALLBACK_INPUT, callback_); - } else { - WLOGFE("WindowInputChannel is not available"); - pointerEvent->MarkProcessed(); - moveEvent_ = nullptr; - } - } - WLOGFI("Receive move event, windowId: %{public}u, action: %{public}d", - window_->GetWindowId(), pointerEvent->GetPointerAction()); - if (pointerEventTemp != nullptr) { - pointerEventTemp->MarkProcessed(); - } - } else { - WLOGFI("Dispatch non-move event, windowId: %{public}u, action: %{public}d", - window_->GetWindowId(), pointerEvent->GetPointerAction()); - window_->ConsumePointerEvent(pointerEvent); - } -} - -void WindowInputChannel::OnVsync(int64_t timeStamp) -{ - std::shared_ptr pointerEvent; - { - std::lock_guard lock(mtx_); - pointerEvent = moveEvent_; - moveEvent_ = nullptr; - } - if (pointerEvent == nullptr) { - WLOGFE("moveEvent_ is nullptr"); - return; - } - WLOGFI("Dispatch move event, windowId: %{public}u, action: %{public}d", - window_->GetWindowId(), pointerEvent->GetPointerAction()); window_->ConsumePointerEvent(pointerEvent); } @@ -123,11 +84,7 @@ void WindowInputChannel::Destroy() std::lock_guard lock(mtx_); WLOGFI("Destroy WindowInputChannel, windowId:%{public}u", window_->GetWindowId()); isAvailable_ = false; - VsyncStation::GetInstance().RemoveCallback(CallbackType::CALLBACK_INPUT, callback_); - if (moveEvent_ != nullptr) { - moveEvent_->MarkProcessed(); - moveEvent_ = nullptr; - } + VsyncStation::GetInstance().RemoveCallback(); } bool WindowInputChannel::IsKeyboardEvent(const std::shared_ptr& keyEvent) const diff --git a/wm/src/window_option.cpp b/wm/src/window_option.cpp index 0b006689..29aae6dd 100644 --- a/wm/src/window_option.cpp +++ b/wm/src/window_option.cpp @@ -150,6 +150,16 @@ WindowTag WindowOption::GetWindowTag() const return windowTag_; } +void WindowOption::SetMainHandlerAvailable(bool isMainHandlerAvailable) +{ + isMainHandlerAvailable_ = isMainHandlerAvailable; +} + +bool WindowOption::GetMainHandlerAvailable() const +{ + return isMainHandlerAvailable_; +} + const PointInfo& WindowOption::GetHitOffset() const { return hitOffset_; diff --git a/wmserver/include/drag_controller.h b/wmserver/include/drag_controller.h index b00625ba..03481930 100644 --- a/wmserver/include/drag_controller.h +++ b/wmserver/include/drag_controller.h @@ -88,7 +88,6 @@ private: void OnReceiveVsync(int64_t timeStamp); void ResetMoveOrDragState(); - std::mutex mtx_; sptr windowProperty_; sptr moveDragProperty_; uint32_t activeWindowId_ = INVALID_WINDOW_ID; diff --git a/wmserver/src/drag_controller.cpp b/wmserver/src/drag_controller.cpp index 17a6f847..d46bd697 100644 --- a/wmserver/src/drag_controller.cpp +++ b/wmserver/src/drag_controller.cpp @@ -185,6 +185,7 @@ bool MoveDragController::Init() inputListener_ = std::make_shared(InputEventListener()); MMI::InputManager::GetInstance()->SetWindowInputEventConsumer(inputListener_, inputEventHandler_); VsyncStation::GetInstance().SetIsMainHandlerAvailable(false); + VsyncStation::GetInstance().SetVsyncEventHandler(inputEventHandler_); return true; } @@ -205,7 +206,6 @@ void MoveDragController::HandleReadyToMoveOrDrag(uint32_t windowId, sptr lock(mtx_); if (activeWindowId_ != windowId) { WLOGFE("end up moving or dragging failed, windowId: %{public}u", windowId); return; @@ -221,7 +221,7 @@ void MoveDragController::HandleWindowRemovedOrDestroyed(uint32_t windowId) if (!(GetMoveDragProperty()->startMoveFlag_ || GetMoveDragProperty()->startDragFlag_)) { return; } - VsyncStation::GetInstance().RemoveCallback(CallbackType::CALLBACK_INPUT, vsyncCallback_); + VsyncStation::GetInstance().RemoveCallback(); ResetMoveOrDragState(); } @@ -232,16 +232,8 @@ void MoveDragController::ConsumePointerEvent(const std::shared_ptrGetPointerAction() == MMI::PointerEvent::POINTER_ACTION_MOVE) { - std::shared_ptr tempPointerEvent; - { - std::lock_guard lock(mtx_); - tempPointerEvent = moveEvent_; - moveEvent_ = pointerEvent; - VsyncStation::GetInstance().RequestVsync(CallbackType::CALLBACK_INPUT, vsyncCallback_); - } - if (tempPointerEvent != nullptr) { - tempPointerEvent->MarkProcessed(); - } + moveEvent_ = pointerEvent; + VsyncStation::GetInstance().RequestVsync(vsyncCallback_); } else { WLOGFI("[WMS] Dispatch non-move event, action: %{public}d", pointerEvent->GetPointerAction()); HandlePointerEvent(pointerEvent); @@ -251,19 +243,13 @@ void MoveDragController::ConsumePointerEvent(const std::shared_ptr pointerEvent; - { - std::lock_guard lock(mtx_); - pointerEvent = moveEvent_; - moveEvent_ = nullptr; - } - if (pointerEvent == nullptr) { + if (moveEvent_ == nullptr) { WLOGFE("moveEvent is nullptr"); return; } - WLOGFD("[OnReceiveVsync] receive move event, action: %{public}d", pointerEvent->GetPointerAction()); - HandlePointerEvent(pointerEvent); - pointerEvent->MarkProcessed(); + WLOGFD("[OnReceiveVsync] receive move event, action: %{public}d", moveEvent_->GetPointerAction()); + HandlePointerEvent(moveEvent_); + moveEvent_->MarkProcessed(); } Rect MoveDragController::GetHotZoneRect()