Skip to content

Commit 6f73ea1

Browse files
EmilyPaekagrina1008
andauthored
WPF - Korean IME fix cursor displayed at the left side of current character (#3912)
Co-authored-by: agrina1008 <[email protected]>
1 parent eb21ea8 commit 6f73ea1

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

CefSharp.Wpf/Experimental/WpfIMEKeyboardHandler.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,17 @@ private void OnImeComposition(IBrowserHost browserHost, IntPtr hwnd, int lParam)
263263

264264
if (ImeHandler.GetComposition(hwnd, (uint)lParam, underlines, ref compositionStart, out text))
265265
{
266-
browserHost.ImeSetComposition(text, underlines.ToArray(),
266+
if(languageCodeId == ImeNative.LANG_KOREAN)
267+
{
268+
browserHost.ImeSetComposition(text, underlines.ToArray(),
269+
new Range(int.MaxValue, int.MaxValue), new Range(compositionStart + underlines.Count, compositionStart + underlines.Count));
270+
}
271+
else
272+
{
273+
browserHost.ImeSetComposition(text, underlines.ToArray(),
267274
new Range(int.MaxValue, int.MaxValue), new Range(compositionStart, compositionStart));
268-
275+
}
276+
269277
UpdateCaretPosition(compositionStart - 1);
270278
}
271279
else

0 commit comments

Comments
 (0)