Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: create sessions for empty app bundle identifiers #979

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading