-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Conversation
Fixes a Korean IME related problem. A user cannot make a word or a sentence by progressing (producing) a single Korean character. Current experimental handler fails to 'emit' a composed Korean character.
✅ Build CefSharp 79.1.360-CI3434 completed (commit 74994e1d8b by @billshinji) |
@@ -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; |
There was a problem hiding this comment.
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.
✅ Build CefSharp 79.1.360-CI3435 completed (commit b5f097effd by @billshinji) |
@@ -241,16 +241,21 @@ private void CloseImeComposition() | |||
private void OnImeComposition(IntPtr hwnd, int lParam) | |||
{ | |||
string text = string.Empty; | |||
|
|||
There was a problem hiding this comment.
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.
} | ||
else | ||
{ | ||
var underlines = new List<CompositionUnderline>(); | ||
int compositionStart = 0; | ||
|
||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh the whitespaces! I see. Sorry for the inconvenience. :-)
✅ Build CefSharp 79.1.360-CI3436 completed (commit d58235e339 by @billshinji) |
Thanks, hopefully others can test and report back. |
Fixes [issue-number]
Summary: [summary of the change and which issue is fixed here]
Changes: [specify the structures changed]
just below the following line inside the function
OnImeComposition()
owner.GetBrowserHost().ImeCommitText(text, new Range(int.MaxValue, int.MaxValue), 0);
string text = string.Empty;
) in order to reference 'underlines' and 'compositionStart' in the newly-added code above:I also figured out there is no side effects to Japanese or Chinese IME even if I skipped the
if
test (if (languageCodeId == ImeNative.LANG_KOREAN)
) but I don't want to make any side effects not found during my own test. It is 'experimental' anyway and we need to improve the WPF IME problem over time.How Has This Been Tested?
Using CefSharp.Wpf.Example.SimpleMainWindow.xaml, (and plugging in the experimental IME keyboard handler of course) I typed several Korean, Japanese, and Chinese sentences.
Windows 10.0.18363.592 (x64) - Korean, Japanese, and Chinese IME installed
Screenshots (if appropriate):
Types of changes
Checklist: