SessionCtl // Make clientBundleIdentifier into a stored variable.
This commit is contained in:
parent
ba164520fc
commit
8b0283cf51
|
@ -43,6 +43,10 @@ public class SessionCtl: IMKInputController {
|
|||
/// 當前副本的客體是否是輸入法本體?
|
||||
public var isServingIMEItself: Bool = false
|
||||
|
||||
/// 用以存儲客體的 bundleIdentifier。
|
||||
/// 由於每次動態獲取都會耗時,所以這裡直接靜態記載之。
|
||||
public var clientBundleIdentifier: String = ""
|
||||
|
||||
// MARK: -
|
||||
|
||||
/// 當前 Caps Lock 按鍵是否被摁下。
|
||||
|
@ -216,6 +220,7 @@ public extension SessionCtl {
|
|||
if let senderBundleID: String = (sender as? IMKTextInput)?.bundleIdentifier() {
|
||||
vCLog("activateServer(\(senderBundleID))")
|
||||
isServingIMEItself = Bundle.main.bundleIdentifier == senderBundleID
|
||||
clientBundleIdentifier = senderBundleID
|
||||
}
|
||||
}
|
||||
DispatchQueue.main.async {
|
||||
|
|
|
@ -11,11 +11,6 @@ import Shared
|
|||
// MARK: - InputHandler Delegate
|
||||
|
||||
extension SessionCtl: InputHandlerDelegate {
|
||||
public var clientBundleIdentifier: String {
|
||||
guard let client = client() else { return "" }
|
||||
return client.bundleIdentifier() ?? ""
|
||||
}
|
||||
|
||||
public func candidateController() -> CtlCandidateProtocol? { candidateUI }
|
||||
|
||||
public func candidateSelectionCalledByInputHandler(at index: Int) {
|
||||
|
|
Loading…
Reference in New Issue