Skip to content

Fix an issue where input controls initialized with InputMethod.IsInputMethodEnable=false could still use IME in their initial state. #18816

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

Merged
merged 1 commit into from
May 9, 2025

Conversation

comesx4
Copy link
Contributor

@comesx4 comesx4 commented May 8, 2025

What does the pull request do?

This PR fixes incorrect IME state management when initializing input controls with disabled IME. The changes ensure proper language ID tracking and IME state updates.

What is the current behavior?

  • Input controls initialized with InputMethod.IsInputMethodEnable=false can still use IME in their initial state
  • Premature _langId assignment in SetLanguageAndWindow prevents proper detection of language ID changes

What is the updated/expected behavior with this PR?

  • IME should remain disabled for controls initialized with InputMethod.IsInputMethodEnable=false
  • IME state updates should correctly reflect language ID changes through the SetLanguageAndWindow method

How was the solution implemented (if it's not obvious)?

  • Removed premature _langId assignment in Imm32InputMethod.SetLanguageAndWindow
  • Ensured subsequent logic uses updated language ID values for IME state management
  • Modified IME enable/disable flow to respect the initial IsInputMethodEnable setting

Checklist

Breaking changes

None

Obsoletions / Deprecations

None

Fixed issues

Fixes #11273

- In `Imm32InputMethod.cs`, removed the premature assignment to `_langId` within the `SetLanguageAndWindow` method to ensure subsequent logic correctly recognizes langId changes and properly updates the IME state.
- Fixed an issue where input controls initialized with `InputMethod.IsInputMethodEnable=false` could still use IME in their initial state.
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 12.0.999-cibuild0056411-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@cla-avalonia
Copy link
Collaborator

cla-avalonia commented May 8, 2025

  • All contributors have signed the CLA.

@maxkatz6 maxkatz6 added bug os-windows backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch labels May 8, 2025
@comesx4
Copy link
Contributor Author

comesx4 commented May 9, 2025

@cla-avalonia agree

@MrJul MrJul added this pull request to the merge queue May 9, 2025
Merged via the queue into AvaloniaUI:master with commit 1a02de5 May 9, 2025
11 checks passed
MrJul pushed a commit that referenced this pull request Jun 5, 2025
- In `Imm32InputMethod.cs`, removed the premature assignment to `_langId` within the `SetLanguageAndWindow` method to ensure subsequent logic correctly recognizes langId changes and properly updates the IME state.
- Fixed an issue where input controls initialized with `InputMethod.IsInputMethodEnable=false` could still use IME in their initial state.
@MrJul MrJul added backported-11.3.x and removed backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch labels Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InputMethod disabling is not working
5 participants