From e5fcb33e8d55a4bdbe16cbf6e138c313327248cd Mon Sep 17 00:00:00 2001 From: TMOONLIGHT Date: Mon, 11 Jan 2021 18:30:38 +0800 Subject: [PATCH] Update WpfIMEKeyboardHandler.cs (#3346) fix chinese IMEs ( such as "sogou pinyin", "qq pinyin" etc. ) input window position. --- CefSharp.Wpf/Experimental/WpfIMEKeyboardHandler.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CefSharp.Wpf/Experimental/WpfIMEKeyboardHandler.cs b/CefSharp.Wpf/Experimental/WpfIMEKeyboardHandler.cs index 7aea55bfe..103b2e8fe 100644 --- a/CefSharp.Wpf/Experimental/WpfIMEKeyboardHandler.cs +++ b/CefSharp.Wpf/Experimental/WpfIMEKeyboardHandler.cs @@ -377,6 +377,18 @@ namespace CefSharp.Wpf.Experimental ImeNative.SetCaretPos(x, y); } + if (languageCodeId == ImeNative.LANG_CHINESE) + { + // Chinese IMEs need set composition window + var compositionPotision = new ImeNative.COMPOSITIONFORM + { + dwStyle = (int)ImeNative.CFS_POINT, + ptCurrentPos = new ImeNative.POINT(x, y), + rcArea = new ImeNative.RECT(0, 0, 0, 0) + }; + ImeNative.ImmSetCompositionWindow(hIMC, ref compositionPotision); + } + if (languageCodeId == ImeNative.LANG_KOREAN) { // Chinese IMEs and Japanese IMEs require the upper-left corner of