Bug 743468 - If IME begins an ephemeral composition string, then end it when done. r=blassey
authorChris Peterson <cpeterson@mozilla.com>
Thu, 26 Apr 2012 23:43:15 -0400
changeset 92569 620c80e2a02486d3f3b4d77f89846c8e2b7f8f77
parent 92568 b7a03f6f1a3eff55f9052c23bb6c7276e7ec23fe
child 92584 a2f61f95b2c3d869826f6bf6e3d1a04e75cab450
push id8755
push usercpeterson@mozilla.com
push dateFri, 27 Apr 2012 03:49:50 +0000
treeherdermozilla-inbound@620c80e2a024 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey
bugs743468
milestone15.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 743468 - If IME begins an ephemeral composition string, then end it when done. r=blassey
mobile/android/base/GeckoInputConnection.java
--- a/mobile/android/base/GeckoInputConnection.java
+++ b/mobile/android/base/GeckoInputConnection.java
@@ -587,17 +587,18 @@ public class GeckoInputConnection
             // we can send Gecko keydown/keyup events instead of composition events.
             if (mCommittingText && !hasCompositionString() && synthesizeKeyEvents(changedChar)) {
                 // Block this thread until all pending events are processed
                 GeckoAppShell.geckoEventSync();
                 return;
             }
         }
 
-        if (!hasCompositionString()) {
+        boolean needCompositionString = !hasCompositionString();
+        if (needCompositionString) {
             if (DEBUG) Log.d(LOGTAG, ". . . onTextChanged: IME_COMPOSITION_BEGIN");
             GeckoAppShell.sendEventToGecko(
                 GeckoEvent.createIMEEvent(GeckoEvent.IME_COMPOSITION_BEGIN, 0, 0));
             mCompositionStart = start;
 
             if (DEBUG) {
                 Log.d(LOGTAG, ". . . onTextChanged: IME_SET_SELECTION, start=" + start + ", len="
                               + before);
@@ -614,17 +615,17 @@ public class GeckoInputConnection
                           + ", 0");
         }
 
         GeckoAppShell.sendEventToGecko(
             GeckoEvent.createIMEEvent(GeckoEvent.IME_SET_SELECTION, start + count, 0));
 
         // End composition if all characters in the word have been deleted.
         // This fixes autocomplete results not appearing.
-        if (count == 0)
+        if (count == 0 || needCompositionString)
             endComposition();
 
         // Block this thread until all pending events are processed
         GeckoAppShell.geckoEventSync();
     }
 
     private boolean synthesizeKeyEvents(char inputChar) {
         if (mKeyCharacterMap == null) {