Bug 1302980 - Don't reset IME context on preedit_end. r?masayuki draft
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Fri, 16 Sep 2016 18:00:25 +0900
changeset 414405 d15334ae7f0998576583248f5c0edccf9abafa1b
parent 414340 edfff7a9e4c43f6d516dfbf69a64e205e5cdb699
child 531434 e9db0d0902fbbe1d563f9b2972254a9116a6c11f
push id29660
push userm_kato@ga2.so-net.ne.jp
push dateFri, 16 Sep 2016 09:03:58 +0000
reviewersmasayuki
bugs1302980
milestone51.0a1
Bug 1302980 - Don't reset IME context on preedit_end. r?masayuki You know, when Korean IME commits string, then it sometimes set next preedit string. So reseting context causes that next preedit string is committed. So we shouldn't reset IME context with preedit_end. MozReview-Commit-ID: CZJJvYjcrKY
widget/gtk/IMContextWrapper.cpp
--- a/widget/gtk/IMContextWrapper.cpp
+++ b/widget/gtk/IMContextWrapper.cpp
@@ -995,17 +995,18 @@ IMContextWrapper::OnSelectionChange(nsWi
 
     // If the selection change is caused by deleting surrounding text,
     // we shouldn't need to notify IME of selection change.
     if (mIsDeletingSurrounding) {
         return;
     }
 
     bool occurredBeforeComposition =
-      IsComposing() && !selectionChangeData.mOccurredDuringComposition;
+      IsComposing() && !selectionChangeData.mOccurredDuringComposition &&
+      !selectionChangeData.mCausedByComposition;
     if (occurredBeforeComposition) {
         mPendingResettingIMContext = true;
     }
 
     // When the selection change is caused by dispatching composition event,
     // selection set event and/or occurred before starting current composition,
     // we shouldn't notify IME of that and commit existing composition.
     if (!selectionChangeData.mCausedByComposition &&