diff options
author | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-15 10:25:39 +0000 |
---|---|---|
committer | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-15 10:25:39 +0000 |
commit | 32b8072a2ac29592417255fb6efafee33e46d70e (patch) | |
tree | f1bbacd166dd44dc757eb81bb7c7ad9f6134174f | |
parent | 3388d4c672226f7da116211ec90ee8c57778d7b1 (diff) | |
download | chromium_src-32b8072a2ac29592417255fb6efafee33e46d70e.zip chromium_src-32b8072a2ac29592417255fb6efafee33e46d70e.tar.gz chromium_src-32b8072a2ac29592417255fb6efafee33e46d70e.tar.bz2 |
A quick fix for Issue 11683.
I noticed this issue is caused by the IMF_AUTOKEYBOARD option of a RichEdit control, an option that allows a RichEdit control to automatically change the input language with a selection. (An omnibox changes a selection to display a styled text.) A RichEdit control automatically turns on the IMF_AUTOKEYBOARD option when we input an RTL character and start changing the input language with a selection. So, this change checks the IMF_AUTOKEYBOARD option and disable it before decorating a text to prevent it from changing the input language while decorating a text.
BUG=11683 "RTL: IME changes when writing a Hebrew character inside an English string in the omnibox"
TEST=Change the input language to English, type "abcd" in an omnibox, change the input language to Hebrew, type an 'a' key, and verify the input language is Hebrew.
Review URL: http://codereview.chromium.org/113394
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16154 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_edit_view_win.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc index 7a20c71..d7aeba9 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc @@ -1631,6 +1631,15 @@ void AutocompleteEditViewWin::HandleKeystroke(UINT message, ScopedFreeze freeze(this, GetTextObjectModel()); OnBeforePossibleChange(); DefWindowProc(message, key, MAKELPARAM(repeat_count, flags)); + + // CRichEditCtrl automatically turns on IMF_AUTOKEYBOARD when the user + // inputs an RTL character, making it difficult for the user to control + // what language is set as they type. Force this off to make the edit's + // behavior more stable. + const int lang_options = SendMessage(EM_GETLANGOPTIONS, 0, 0); + if (lang_options & IMF_AUTOKEYBOARD) + SendMessage(EM_SETLANGOPTIONS, 0, lang_options & ~IMF_AUTOKEYBOARD); + OnAfterPossibleChange(); } |