Skip to content

Commit

Permalink
fix: create sessions for empty app bundle identifiers
Browse files Browse the repository at this point in the history
Closes #977
  • Loading branch information
ksqsf committed Sep 9, 2024
1 parent 9e477f0 commit 1ee2083
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sources/SquirrelInputController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import InputMethodKit

final class SquirrelInputController: IMKInputController {
private static let keyRollOver = 50
private static var unknownAppCnt: UInt = 0

private weak var client: IMKTextInput?
private let rimeAPI: RimeApi_stdbool = rime_get_api_stdbool().pointee
Expand Down Expand Up @@ -332,7 +333,10 @@ private extension SquirrelInputController {
}

func createSession() {
guard let app = client?.bundleIdentifier() else { return }
let app = client?.bundleIdentifier() ?? {
SquirrelInputController.unknownAppCnt &+= 1
return "UnknownApp\(SquirrelInputController.unknownAppCnt)"
}()
print("createSession: \(app)")
currentApp = app
session = rimeAPI.create_session()
Expand Down

0 comments on commit 1ee2083

Please sign in to comment.