Signed-off-by: ma-shaoyin <mashaoyin1@huawei.com>

Changes to be committed:
This commit is contained in:
ma-shaoyin 2024-10-18 10:05:32 +08:00
parent 0e287bf89a
commit d4e19e11aa

View File

@ -858,15 +858,14 @@ int32_t InputMethodAbility::ShowPanel(const std::shared_ptr<InputMethodPanel> &i
int32_t InputMethodAbility::HidePanel(const std::shared_ptr<InputMethodPanel> &inputMethodPanel)
{
// Current Ime is exiting, hide softkeyboard will cause the TextFiled to lose focus.
if (isImeTerminating.load() && inputMethodPanel != nullptr &&
inputMethodPanel->GetPanelType() == PanelType::SOFT_KEYBOARD) {
if (inputMethodPanel == nullptr) {
return ErrorCode::ERROR_BAD_PARAMETERS;
}
if (isImeTerminating.load() && inputMethodPanel->GetPanelType() == PanelType::SOFT_KEYBOARD) {
IMSA_HILOGI("Current Ime is terminating, no need to hide keyboard.");
return ErrorCode::NO_ERROR;
}
std::lock_guard<std::recursive_mutex> lock(keyboardCmdLock_);
if (inputMethodPanel == nullptr) {
return ErrorCode::ERROR_BAD_PARAMETERS;
}
return HidePanel(inputMethodPanel, inputMethodPanel->GetPanelFlag(), Trigger::IME_APP, false);
}