Skip to content

fix: restrict kana input-source lookup to keyboard category#116

Merged
kazukinakai merged 1 commit into
mainfrom
fix/kana-keyboard-category-filter
Jul 3, 2026
Merged

fix: restrict kana input-source lookup to keyboard category#116
kazukinakai merged 1 commit into
mainfrom
fix/kana-keyboard-category-filter

Conversation

@kazukinakai

Copy link
Copy Markdown
Member

Problem (v2.4.7 regression)

The kana switch picked any enabled input source with language "ja". On machines with the 50-on Kana Palette enabled, this selected the palette-category source — opening a floating kana palette window instead of switching to Hiragana.

The intended Hiragana preference also never matched: it compared the input source ID against com.apple.inputmethod.Japanese, but that value is the input mode ID (the source ID carries an IME-specific prefix, e.g. …Kotoeri.RomajiTyping.Japanese).

Fix

  • Restrict TISCreateInputSourceList to kTISCategoryKeyboardInputSource and require kTISPropertyInputSourceIsSelectCapable.
  • Prefer Hiragana by matching kTISPropertyInputModeID == "com.apple.inputmethod.Japanese".

Verification

  • New regression test testJapaneseInputSource_NeverPicksPalette asserts the picked source is keyboard-category and the Hiragana mode; passes (not skipped) on a machine with Japanese IME + palettes enabled — reproduced environment of the report.
  • swift build clean, 34/34 tests pass, swiftlint 0 errors (violations back to the pre-existing 8).

Version 2.4.8 (auto-release on merge → Sparkle update).

v2.4.7 selected any enabled input source with language "ja", which could
match the palette-category Kana Palette and open a floating palette window
instead of switching the IME. Restrict the TIS lookup to keyboard input
sources, require select-capable, and match the Hiragana input mode by its
mode ID (the input source ID carries an IME-specific prefix, so the previous
exact-ID match never hit).
@kazukinakai kazukinakai enabled auto-merge July 3, 2026 12:59
@kazukinakai kazukinakai merged commit a67b470 into main Jul 3, 2026
2 checks passed
@kazukinakai kazukinakai deleted the fix/kana-keyboard-category-filter branch July 3, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant