SessionCtl // Add isBootingUp().

This commit is contained in:
ShikiSuen 2023-06-21 22:44:05 +08:00
parent 45c8620c01
commit cbdcb1a7c8
2 changed files with 12 additions and 1 deletions

View File

@ -58,6 +58,16 @@ public class SessionCtl: IMKInputController {
///
public var isActivated = false
/// activateServer 0.1
public private(set) var isBootingUp: Bool = true {
didSet {
guard isBootingUp else { return }
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
self.isBootingUp = false
}
}
}
///
public var isServingIMEItself: Bool = false
@ -274,6 +284,7 @@ public extension SessionCtl {
/// - Parameter sender:
override func activateServer(_ sender: Any!) {
super.activateServer(sender)
isBootingUp = true
DispatchQueue.main.async { [self] in
if let senderBundleID: String = (sender as? IMKTextInput)?.bundleIdentifier() {
vCLog("activateServer(\(senderBundleID))")

View File

@ -183,7 +183,7 @@ public extension SessionCtl {
///
/// IMKCandidates
internal func keepIMKCandidatesShownUp() {
guard PrefMgr.shared.useIMKCandidateWindow else { return }
guard PrefMgr.shared.useIMKCandidateWindow, isBootingUp else { return }
guard let imkC = candidateUI as? CtlCandidateIMK else { return }
var i: Double = 0
while i < 1 {