Bug 699022 - Inform IM about cursor position when focus changes. r=masayuki

Differential Revision: https://phabricator.services.mozilla.com/D62734

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Xidorn Quan 2020-02-13 12:19:05 +00:00
Родитель 96274c2281
Коммит efd45a6971
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -1115,6 +1115,13 @@ void IMContextWrapper::OnFocusChangeInGecko(bool aFocus) {
// We shouldn't carry over the removed string to another editor.
mSelectedStringRemovedByComposition.Truncate();
mSelection.Clear();
// When the focus changes, we need to inform IM about the new cursor
// position. Chinese input methods generally rely on this because they
// usually don't start composition until a character is picked.
if (aFocus && EnsureToCacheSelection()) {
SetCursorPosition(GetActiveContext());
}
}
void IMContextWrapper::ResetIME() {