diff --git a/kawa/InputSourceManager.swift b/kawa/InputSourceManager.swift index 6e3f0d1..0960721 100644 --- a/kawa/InputSourceManager.swift +++ b/kawa/InputSourceManager.swift @@ -54,7 +54,15 @@ class InputSource: Equatable { } func select() { - TISSelectInputSource(tisInputSource) + let langs = InputSource.getProperty(tisInputSource, kTISPropertyInputSourceLanguages)! as Array + + if langs.contains(where: { $0 == "ko" || $0 == "ja" || $0.hasPrefix("zh") }) { + // Workaround for TIS CJK layout bug: + // FIXME: when it's CJK, select English first and then return + print("CJK") + } else { + TISSelectInputSource(tisInputSource) + } } func getRetinaImageURL(_ path: URL) -> URL {