diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ComboBox.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ComboBox.cs index afdfb097e04..d39bdd80706 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ComboBox.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ComboBox.cs @@ -1828,6 +1828,11 @@ private void ChildWndProc(ref Message m) // once in the combobox and once here. if (fireSetFocus) { + if (!DesignMode && childEdit != null && m.HWnd == childEdit.Handle) + { + WmImeSetFocus(); + } + InvokeGotFocus(this, EventArgs.Empty); } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Control.Ime.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Control.Ime.cs index 13492d9709d..f66ba0a2ea5 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Control.Ime.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Control.Ime.cs @@ -52,12 +52,6 @@ public partial class Control : /// private static bool ignoreWmImeNotify; - /// - /// This flag works around an Issue with the Chinese IME sending IMENotify messages prior to WmInputLangChange - /// which would cause this code to use OnHalf as the default mode overriding .ImeMode property. See WmImeNotify - /// - private static bool lastLanguageChinese = false; - /// /// The ImeMode in the property store. /// @@ -711,11 +705,6 @@ private void WmInputLangChange(ref Message m) PropagatingImeMode = ImeMode.Off; } - if (ImeModeConversion.InputLanguageTable == ImeModeConversion.ChineseTable) - { - IgnoreWmImeNotify = false; - } - Form form = FindForm(); if (form != null) @@ -787,24 +776,7 @@ private void WmImeEndComposition(ref Message m) /// private void WmImeNotify(ref Message m) { - ImeMode[] inputLanguageTable = ImeModeConversion.InputLanguageTable; - - // During a change to the Chinese language with Focus already set, the Chinese IME will send several WmImeNotify messages - // before ever sending a WmInputLangChange event. Also, the IME will report an IME input context during this time that we - // interpret as On = 'OnHalf'. The combination of these causes us to update the default Cached ImeMode to OnHalf, overriding - // the control's ImeMode property -- unwanted behavior. We workaround this by skipping our mode synchronization during these - // IMENotify messages until we get a WmInputLangChange event. - // - // If this is the first time here after conversion to chinese language, wait for WmInputLanguageChange - // before listening to WmImeNotifys. - if ((inputLanguageTable == ImeModeConversion.ChineseTable) && !lastLanguageChinese) - { - IgnoreWmImeNotify = true; - } - - lastLanguageChinese = (inputLanguageTable == ImeModeConversion.ChineseTable); - - if (ImeSupported && inputLanguageTable != ImeModeConversion.UnsupportedTable && !IgnoreWmImeNotify) + if (ImeSupported && ImeModeConversion.InputLanguageTable != ImeModeConversion.UnsupportedTable && !IgnoreWmImeNotify) { int wparam = (int)m.WParam;