SessionCtl // Add certain details among vCLog outputs.

This commit is contained in:
ShikiSuen 2022-11-30 00:35:39 +08:00
parent 197b6d69fd
commit 58bcea2507
1 changed files with 10 additions and 1 deletions

View File

@ -71,7 +71,11 @@ public class SessionCtl: IMKInputController {
public var state: IMEStateProtocol = IMEState.ofEmpty() {
didSet {
guard oldValue.type != state.type else { return }
vCLog("Current State: \(state.type.rawValue), client: \(clientBundleIdentifier)")
if PrefMgr.shared.isDebugModeEnabled {
var stateDescription = state.type.rawValue
if state.type == .ofCommitting { stateDescription += "(\(state.textToCommit))" }
vCLog("Current State: \(stateDescription), client: \(clientBundleIdentifier)")
}
//
// guard state.isCandidateContainer != oldValue.isCandidateContainer else { return }
// if state.isCandidateContainer || oldValue.isCandidateContainer { setKeyLayout() }
@ -197,6 +201,11 @@ extension SessionCtl {
/// - Parameter sender: 使
public override func activateServer(_ sender: Any!) {
_ = sender //
DispatchQueue.main.async {
if let senderBundleID: String = (sender as? IMKTextInput)?.bundleIdentifier() {
vCLog("activateServer(\(senderBundleID))")
}
}
DispatchQueue.main.async { [self] in
if isActivated { return }