mirror of
https://gitee.com/openharmony/window_window_manager
synced 2024-11-23 06:50:40 +00:00
!10945 输入法事务同步增强
Merge pull request !10945 from wulehui/ModifyKeyboardSync-1
This commit is contained in:
commit
750556dc70
@ -533,12 +533,18 @@ void KeyboardSession::RelayoutKeyBoard()
|
||||
|
||||
void KeyboardSession::OpenKeyboardSyncTransaction()
|
||||
{
|
||||
if (isKeyboardSyncTransactionOpen_) {
|
||||
TLOGI(WmsLogTag::WMS_KEYBOARD, "Keyboard sync transaction is already open");
|
||||
return;
|
||||
}
|
||||
isKeyboardSyncTransactionOpen_ = true;
|
||||
auto task = []() {
|
||||
auto task = [weakThis = wptr(this)]() {
|
||||
auto session = weakThis.promote();
|
||||
if (!session) {
|
||||
TLOGNE(WmsLogTag::WMS_KEYBOARD, "keyboard session is null");
|
||||
return WSError::WS_ERROR_DESTROYED_OBJECT;
|
||||
}
|
||||
if (session->isKeyboardSyncTransactionOpen_) {
|
||||
TLOGNI(WmsLogTag::WMS_KEYBOARD, "Keyboard sync transaction is already open");
|
||||
return WSError::WS_OK;
|
||||
}
|
||||
TLOGNI(WmsLogTag::WMS_KEYBOARD, "Open keyboard sync");
|
||||
session->isKeyboardSyncTransactionOpen_ = true;
|
||||
auto transactionController = RSSyncTransactionController::GetInstance();
|
||||
if (transactionController) {
|
||||
transactionController->OpenSyncTransaction();
|
||||
@ -551,14 +557,14 @@ void KeyboardSession::OpenKeyboardSyncTransaction()
|
||||
void KeyboardSession::CloseKeyboardSyncTransaction(const WSRect& keyboardPanelRect,
|
||||
bool isKeyboardShow, bool isRotating)
|
||||
{
|
||||
TLOGI(WmsLogTag::WMS_KEYBOARD, "keyboardPanelRect: %{public}s, isKeyboardShow: %{public}d, isRotating: %{public}d",
|
||||
keyboardPanelRect.ToString().c_str(), isKeyboardShow, isRotating);
|
||||
auto task = [weakThis = wptr(this), keyboardPanelRect, isKeyboardShow, isRotating]() {
|
||||
auto session = weakThis.promote();
|
||||
if (!session) {
|
||||
TLOGE(WmsLogTag::WMS_KEYBOARD, "keyboard session is null");
|
||||
return WSError::WS_ERROR_DESTROYED_OBJECT;
|
||||
}
|
||||
TLOGNI(WmsLogTag::WMS_KEYBOARD, "Close keyboard sync, isKeyboardShow: %{public}d, isRotating: %{public}d",
|
||||
isKeyboardShow, isRotating);
|
||||
std::shared_ptr<RSTransaction> rsTransaction = nullptr;
|
||||
if (!isRotating && session->isKeyboardSyncTransactionOpen_) {
|
||||
rsTransaction = session->GetRSTransaction();
|
||||
|
Loading…
Reference in New Issue
Block a user