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

WPF - IME Fix Korean character emitting issue #3054

Merged
merged 3 commits into from
Feb 12, 2020
Merged
Changes from 1 commit
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
12 changes: 8 additions & 4 deletions CefSharp.Wpf/Experimental/WpfIMEKeyboardHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,20 @@ private void CloseImeComposition()
private void OnImeComposition(IntPtr hwnd, int lParam)
{
string text = string.Empty;

var underlines = new List<CompositionUnderline>();
int compositionStart = 0;
Copy link
Member

Choose a reason for hiding this comment

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

Instead of hosting these values up, just pass in an empty array and 0 to ImeSetComposition please. Passing in values directly makes the code clearer.

Move underlines and compositionStart back to their original place.


Copy link
Member

Choose a reason for hiding this comment

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

Please revert formatting change please.

if (ImeHandler.GetResult(hwnd, (uint)lParam, out text))
{
owner.GetBrowserHost().ImeCommitText(text, new Range(int.MaxValue, int.MaxValue), 0);
if (languageCodeId == ImeNative.LANG_KOREAN)
{
owner.GetBrowserHost().ImeSetComposition(text, underlines.ToArray(), new Range(int.MaxValue, int.MaxValue), new Range(compositionStart, compositionStart));
owner.GetBrowserHost().ImeFinishComposingText(false);
}
}
else
{
var underlines = new List<CompositionUnderline>();
int compositionStart = 0;

if (ImeHandler.GetComposition(hwnd, (uint)lParam, underlines, ref compositionStart, out text))
{
owner.GetBrowserHost().ImeSetComposition(text, underlines.ToArray(),
Expand Down