From 61b6497a2970491e38b8049cd4f817d3bb3afc1b Mon Sep 17 00:00:00 2001 From: maojiangping Date: Sun, 30 Jan 2022 16:09:52 +0800 Subject: [PATCH] Fixed an issue that input window information was not updated to multimodalinput when window is destroyed Signed-off-by: maojiangping Change-Id: I843cb9e1c81c1071ddae767158083217ef64ecde --- wmserver/include/window_controller.h | 1 + wmserver/src/window_controller.cpp | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/wmserver/include/window_controller.h b/wmserver/include/window_controller.h index 15605500db..49078a6290 100644 --- a/wmserver/include/window_controller.h +++ b/wmserver/include/window_controller.h @@ -52,6 +52,7 @@ public: private: uint32_t GenWindowId(); void FlushWindowInfo(uint32_t windowId); + void FlushWindowInfoWithDisplayId(DisplayId displayId); sptr windowRoot_; sptr inputWindowMonitor_; diff --git a/wmserver/src/window_controller.cpp b/wmserver/src/window_controller.cpp index 82c7fd9e6c..af68c9d46b 100644 --- a/wmserver/src/window_controller.cpp +++ b/wmserver/src/window_controller.cpp @@ -95,11 +95,16 @@ WMError WindowController::RemoveWindowNode(uint32_t windowId) WMError WindowController::DestroyWindow(uint32_t windowId) { + DisplayId displayId = DISPLAY_ID_INVALD; + auto node = windowRoot_->GetWindowNode(windowId); + if (node != nullptr) { + displayId = node->GetDisplayId(); + } WMError res = windowRoot_->DestroyWindow(windowId); if (res != WMError::WM_OK) { return res; } - FlushWindowInfo(windowId); + FlushWindowInfoWithDisplayId(displayId); return res; } @@ -315,5 +320,12 @@ void WindowController::FlushWindowInfo(uint32_t windowId) RSTransaction::FlushImplicitTransaction(); inputWindowMonitor_->UpdateInputWindow(windowId); } + +void WindowController::FlushWindowInfoWithDisplayId(DisplayId displayId) +{ + WLOGFI("FlushWindowInfoWithDisplayId"); + RSTransaction::FlushImplicitTransaction(); + inputWindowMonitor_->UpdateInputWindowByDisplayId(displayId); +} } } \ No newline at end of file -- Gitee