Skip to content

Commit

Permalink
fix: create sessions for empty app bundle identifiers (#979)
Browse files Browse the repository at this point in the history
Closes #977
  • Loading branch information
ksqsf authored Sep 10, 2024
1 parent 35d5acd commit 67e87fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion action-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

rime_version=latest
rime_git_hash=2f89098
rime_git_hash=24f0f7b
sparkle_version=2.6.2

rime_archive="rime-${rime_git_hash}-macOS-universal.tar.bz2"
Expand Down
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 67e87fb

Please sign in to comment.