mgrPrefs // Add fixOddPreferences() for activateServer().

This commit is contained in:
ShikiSuen 2022-08-16 08:20:44 +08:00
parent 298c1425be
commit 952eec1215
2 changed files with 16 additions and 4 deletions

View File

@ -111,10 +111,7 @@ class ctlInputMethod: IMKInputController {
keyHandler.clear() // handle State.Empty() keyHandler.clear() // handle State.Empty()
keyHandler.ensureParser() keyHandler.ensureParser()
if #available(macOS 10.13, *) { mgrPrefs.fixOddPreferences()
} else {
mgrPrefs.useIMKCandidateWindow = false // macOS 10.11 IMK
}
if isASCIIMode { if isASCIIMode {
if mgrPrefs.disableShiftTogglingAlphanumericalMode { if mgrPrefs.disableShiftTogglingAlphanumericalMode {

View File

@ -664,6 +664,21 @@ public enum mgrPrefs {
static var usingHotKeyCurrencyNumerals: Bool static var usingHotKeyCurrencyNumerals: Bool
} }
// MARK: Auto parameter fix procedures, executed everytime on ctlInputMethod.activateServer().
extension mgrPrefs {
static func fixOddPreferences() {
// macOS 10.11 IMK
if #unavailable(macOS 10.13) { mgrPrefs.useIMKCandidateWindow = false }
if #unavailable(macOS 10.15) {
handleDefaultCandidateFontsByLangIdentifier = false
shouldAlwaysUseShiftKeyAccommodation = false
disableShiftTogglingAlphanumericalMode = false
togglingAlphanumericalModeWithLShift = false
}
}
}
// MARK: Snapshot Extension // MARK: Snapshot Extension
var snapshot: [String: Any]? var snapshot: [String: Any]?