Repo // Always fix input mode on activateServer().

This commit is contained in:
ShikiSuen 2023-03-31 23:46:42 +08:00
parent 553b493006
commit a031c0d61b
1 changed files with 8 additions and 2 deletions

View File

@ -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 }
} }
} }