Skip to content

appim: optimize parse config#370

Merged
eagleoflqj merged 1 commit into
masterfrom
appim
May 13, 2026
Merged

appim: optimize parse config#370
eagleoflqj merged 1 commit into
masterfrom
appim

Conversation

@eagleoflqj
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR optimizes per-application default input method selection in the macOS frontend by parsing the AppDefaultIM config once during updateConfig() and caching the result for quick lookup during focus changes.

Changes:

  • Added an appDefaultIMCache_ map to store appId -> imName derived from AppDefaultIM.
  • Populated/cleared the cache during MacosFrontend::updateConfig() instead of parsing JSON on every focusIn.
  • Simplified useAppDefaultIM() to a hash-map lookup and IM switch.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
macosfrontend/macosfrontend.h Adds a new member cache (std::unordered_map) to store parsed app default IM mappings.
macosfrontend/macosfrontend.cpp Builds the cache in updateConfig() and uses it in useAppDefaultIM() to avoid repeated JSON parsing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread macosfrontend/macosfrontend.h
Comment thread macosfrontend/macosfrontend.cpp
Comment thread macosfrontend/macosfrontend.cpp
@github-actions
Copy link
Copy Markdown

arm64 comparison

No difference.

x86_64 comparison

No difference.

@eagleoflqj eagleoflqj merged commit d76d3b1 into master May 13, 2026
11 checks passed
@eagleoflqj eagleoflqj deleted the appim branch May 13, 2026 02:18
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.

2 participants