!1277 解决showkwyboard与showpanel卡死问题

Merge pull request !1277 from mashaoyin/master
This commit is contained in:
openharmony_ci 2024-07-05 14:33:28 +00:00 committed by Gitee
commit bbe38b0151
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -252,7 +252,9 @@ int32_t InputMethodAbility::StartInput(const InputClientInfo &clientInfo, bool i
}
isPendingShowKeyboard_ = clientInfo.isShowKeyboard;
if (clientInfo.isShowKeyboard) {
auto task = [this, cmdCount]() { ShowKeyboardImplWithLock(cmdCount); };
auto task = [this, cmdCount]() {
std::thread([this, cmdCount]() { ShowKeyboardImplWithLock(cmdCount); }).detach();
};
if (imeListener_ == nullptr || !imeListener_->PostTaskToEventHandler(task, "ShowKeyboard")) {
IMSA_HILOGE("imeListener_ is nullptr, or post task failed!");
ShowKeyboardImplWithoutLock(cmdCount);