From 7890e815de1370a8cb969c32cf400a2cf6a00cbf Mon Sep 17 00:00:00 2001 From: fanlumaster <1730976608@qq.com> Date: Sun, 18 Jan 2026 17:34:01 +0800 Subject: [PATCH] feat: also sync double/single char status when switch windows --- src/IME/MetasequoiaIME.cpp | 6 ++++-- src/IPC/Ipc.cpp | 11 ++++++++++- src/IPC/Ipc.h | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/IME/MetasequoiaIME.cpp b/src/IME/MetasequoiaIME.cpp index f4fb3078..599d297f 100644 --- a/src/IME/MetasequoiaIME.cpp +++ b/src/IME/MetasequoiaIME.cpp @@ -647,10 +647,12 @@ LRESULT CALLBACK CMetasequoiaIME_WindowProc(HWND hWnd, UINT message, WPARAM wPar break; } case WM_ThreadFocus: { - /* 通知 server 端更新一下 ftb 中英和标点的状态 */ + /* 通知 server 端更新一下 ftb 中英、全半角、标点的状态 */ SendIMEStatusEventToUIProcessViaNamedPipe( // pIME->GetCompositionProcessorEngine()->GetIMEMode(pIME->_GetThreadMgr(), pIME->_GetClientId()), // - pIME->GetCompositionProcessorEngine()->GetPunctuationMode(pIME->_GetThreadMgr(), pIME->_GetClientId())); + pIME->GetCompositionProcessorEngine()->GetDoubleSingleByteMode(pIME->_GetThreadMgr(), + pIME->_GetClientId()), // + pIME->GetCompositionProcessorEngine()->GetPunctuationMode(pIME->_GetThreadMgr(), pIME->_GetClientId())); // break; } default: diff --git a/src/IPC/Ipc.cpp b/src/IPC/Ipc.cpp index 9a216f7f..f99971b6 100644 --- a/src/IPC/Ipc.cpp +++ b/src/IPC/Ipc.cpp @@ -945,10 +945,11 @@ int SendIMEActivationEventToUIProcessViaNamedPipe() * @brief Send IME status to UI process via named pipe * * @param kbdIsOpen + * @param fullwidthIsOpen * @param puncIsOpen * @return int */ -int SendIMEStatusEventToUIProcessViaNamedPipe(bool kbdIsOpen, bool puncIsOpen) +int SendIMEStatusEventToUIProcessViaNamedPipe(bool kbdIsOpen, bool fullwidthIsOpen, bool puncIsOpen) { std::wstring status = L"ftbStatus"; if (kbdIsOpen) @@ -959,6 +960,14 @@ int SendIMEStatusEventToUIProcessViaNamedPipe(bool kbdIsOpen, bool puncIsOpen) { status += L"0"; } + if (fullwidthIsOpen) + { + status += L"1"; + } + else + { + status += L"0"; + } if (puncIsOpen) { status += L"1"; diff --git a/src/IPC/Ipc.h b/src/IPC/Ipc.h index cf231ad4..2460e83d 100644 --- a/src/IPC/Ipc.h +++ b/src/IPC/Ipc.h @@ -117,7 +117,7 @@ int SendMoveCandidateWndEventToUIProcess(); int SendLangbarRightClickEventToUIProcess(const RECT *prcArea); int SendIMEActivationEventToUIProcessViaNamedPipe(); int SendIMEDeactivationEventToUIProcessViaNamedPipe(); -int SendIMEStatusEventToUIProcessViaNamedPipe(bool kbdIsOpen, bool puncIsOpen); +int SendIMEStatusEventToUIProcessViaNamedPipe(bool kbdIsOpen, bool fullwidthIsOpen, bool puncIsOpen); int SendIMESwitchEventToUIProcessViaNamedPipe(UINT uImeStatus); int SendPuncSwitchEventToUIProcessViaNamedPipe(BOOL isPunc); int SendDoubleSingleByteSwitchEventToUIProcessViaNamedPipe(BOOL isDoubleSingleByte);