From 7764acd5cfcfbf06fe42501c0147f1dfd41d7b71 Mon Sep 17 00:00:00 2001 From: maojiangping Date: Thu, 21 Apr 2022 16:16:56 +0800 Subject: [PATCH] Fix an issue that it will crash when the poinrter down event is received after window is hidden. Signed-off-by: maojiangping Change-Id: Idddce1dde0d7783bd85cd36aea3ff39db62ea405 Signed-off-by: maojiangping --- wmserver/src/window_controller.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wmserver/src/window_controller.cpp b/wmserver/src/window_controller.cpp index 3a928312..27a0c8ab 100644 --- a/wmserver/src/window_controller.cpp +++ b/wmserver/src/window_controller.cpp @@ -436,6 +436,10 @@ WMError WindowController::ProcessPointDown(uint32_t windowId, bool isStartDrag) WLOGFW("could not find window"); return WMError::WM_ERROR_NULLPTR; } + if (!node->currentVisibility_) { + WLOGFE("this window is not visibile and not in window tree, windowId: %{public}u", windowId); + return WMError::WM_ERROR_INVALID_OPERATION; + } if (isStartDrag) { WMError res = windowRoot_->UpdateSizeChangeReason(windowId, WindowSizeChangeReason::DRAG_START);