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

Clear Imm32InputMethod.Composition after receiving cancel message (WM_IME_COMPOSITION with lParam set to 0) #18034

Open
wants to merge 1 commit into from

Conversation

MineCake147E
Copy link

What does the pull request do?

This PR clears Imm32InputMethod.Composition when AppWndProc receives WM_IME_COMPOSITION message with lParam set to 0, which apparently means that the IME canceled the composition entirely.

What is the current behavior?

HandleComposition does nothing if lParam were 0, which causes #18021 by HandleCompositionEnd erroneously executes _parent.Input(e); with uncleared Composition.

What is the updated/expected behavior with this PR?

HandleComposition now clears Composition if lParam were 0. HandleCompositionEnd now sees the empty Composition after IME cancelling the composition.

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

if (flags == 0)
{
    CompositionChanged("");
}

Checklist

  • Added unit tests (I don't think it's possible since it needs IME installed in testing environment)
  • Added XML documentation to any related classes?
  • Consider submitting a PR to https://github.com/AvaloniaUI/avalonia-docs with user documentation

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes #18021

Copy link
Contributor

@Gillibald Gillibald left a comment

Choose a reason for hiding this comment

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

Looks good. Thank you for your contribution.

@avaloniaui-bot
Copy link

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

@cla-avalonia
Copy link
Collaborator

cla-avalonia commented Jan 23, 2025

  • All contributors have signed the CLA.

@MineCake147E

This comment was marked as off-topic.

@MrJul MrJul added this pull request to the merge queue Jan 23, 2025
@MrJul MrJul added the backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch bug os-windows
Projects
None yet
5 participants