Repo // Always fix input mode on activateServer().
This commit is contained in:
parent
553b493006
commit
a031c0d61b
|
@ -138,7 +138,7 @@ public class SessionCtl: IMKInputController {
|
||||||
|
|
||||||
/// InputMode 需要在每次出現內容變更的時候都連帶重設組字器與各項語言模組,
|
/// InputMode 需要在每次出現內容變更的時候都連帶重設組字器與各項語言模組,
|
||||||
/// 順帶更新 IME 模組及 UserPrefs 當中對於當前語言模式的記載。
|
/// 順帶更新 IME 模組及 UserPrefs 當中對於當前語言模式的記載。
|
||||||
public var inputMode: Shared.InputMode = IMEApp.currentInputMode {
|
public var inputMode: Shared.InputMode = .imeModeNULL {
|
||||||
willSet {
|
willSet {
|
||||||
/// 將新的簡繁輸入模式提報給 Prefs 模組。IMEApp 模組會據此計算正確的資料值。
|
/// 將新的簡繁輸入模式提報給 Prefs 模組。IMEApp 模組會據此計算正確的資料值。
|
||||||
PrefMgr.shared.mostRecentInputMode = newValue.rawValue
|
PrefMgr.shared.mostRecentInputMode = newValue.rawValue
|
||||||
|
@ -258,6 +258,11 @@ public extension SessionCtl {
|
||||||
PrefMgr.shared.shouldNotFartInLieuOfBeep = true
|
PrefMgr.shared.shouldNotFartInLieuOfBeep = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
DispatchQueue.main.async { [self] in
|
||||||
|
if inputMode != IMEApp.currentInputMode {
|
||||||
|
inputMode = IMEApp.currentInputMode
|
||||||
|
}
|
||||||
|
}
|
||||||
DispatchQueue.main.async { [self] in
|
DispatchQueue.main.async { [self] in
|
||||||
if isActivated { return }
|
if isActivated { return }
|
||||||
|
|
||||||
|
@ -313,7 +318,8 @@ public extension SessionCtl {
|
||||||
_ = tag // 防止格式整理工具毀掉與此對應的參數。
|
_ = tag // 防止格式整理工具毀掉與此對應的參數。
|
||||||
_ = sender // 防止格式整理工具毀掉與此對應的參數。
|
_ = sender // 防止格式整理工具毀掉與此對應的參數。
|
||||||
DispatchQueue.main.async { [self] in
|
DispatchQueue.main.async { [self] in
|
||||||
inputMode = .init(rawValue: value as? String ?? PrefMgr.shared.mostRecentInputMode) ?? .imeModeNULL
|
let newMode: Shared.InputMode = .init(rawValue: value as? String ?? PrefMgr.shared.mostRecentInputMode) ?? .imeModeNULL
|
||||||
|
if inputMode != newMode { inputMode = newMode }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue