大桌面场景下处理键盘关闭使用requestHideInput而非Close

Signed-off-by: zhoukechen <zhoukechen2@huawei.com>
Change-Id: Ib3fe7103f996225f94fae67a3fa7cca9c5e2446c
This commit is contained in:
zhoukechen 2024-11-12 14:40:01 +08:00
parent af8442b744
commit 8c002c3334

View File

@ -166,11 +166,12 @@ void WindowSceneHelper::IsCloseKeyboard(const RefPtr<FrameNode>& frameNode)
bool isNeedKeyBoard = curPattern->NeedSoftKeyboard();
auto saveKeyboard = IsFocusWindowSceneCloseKeyboard(frameNode);
TAG_LOGI(AceLogTag::ACE_KEYBOARD,
"FrameNode(%{public}s/%{public}d) notNeedSoftKeyboard, Keep:%{public}d, Need:%{public}d)",
"FrameNode(%{public}s/%{public}d) notNeed SoftKeyboard, Keep:%{public}d, Need:%{public}d)",
frameNode->GetTag().c_str(), frameNode->GetId(), !saveKeyboard, !isNeedKeyBoard);
if (!saveKeyboard && !isNeedKeyBoard) {
auto inputMethod = MiscServices::InputMethodController::GetInstance();
if (inputMethod) {
inputMethod->RequestHideInput();
inputMethod->Close();
TAG_LOGI(AceLogTag::ACE_KEYBOARD, "SoftKeyboard Closes Successfully.");
}