Bug 821229 - Don't show/hide VKB when Gecko view doesn't have focus; r=cpeterson
authorJim Chen <nchen@mozilla.com>
Tue, 18 Dec 2012 12:21:25 -0500
changeset 125521 d2ee611a3e2362105784134ce1a6704ade3fc5ea
parent 125520 72ccbd7bc1087c9b9cb9e91210bd5cb8a0c0128b
child 125522 ce156ff6dfdedc480993df3e0ada52aa26da3ef0
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpeterson
bugs821229
milestone20.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 821229 - Don't show/hide VKB when Gecko view doesn't have focus; r=cpeterson
mobile/android/base/GeckoInputConnection.java
--- a/mobile/android/base/GeckoInputConnection.java
+++ b/mobile/android/base/GeckoInputConnection.java
@@ -512,16 +512,24 @@ class GeckoInputConnection
 
         /* When IME is 'disabled', IME processing is disabled.
            In addition, the IME UI is hidden */
         mIMEState = state;
         mIMETypeHint = (typeHint == null) ? "" : typeHint;
         mIMEModeHint = (modeHint == null) ? "" : modeHint;
         mIMEActionHint = (actionHint == null) ? "" : actionHint;
 
+        View v = getView();
+        if (v == null || !v.hasFocus()) {
+            // When using Find In Page, we can still receive notifyIMEEnabled calls due to the
+            // selection changing when highlighting. However in this case we don't want to reset/
+            // show/hide the keyboard because the find box has the focus and is taking input from
+            // the keyboard.
+            return;
+        }
         restartInput();
         GeckoApp.mAppContext.mMainHandler.postDelayed(new Runnable() {
             public void run() {
                 if (mIMEState == IME_STATE_DISABLED) {
                     hideSoftInput();
                 } else {
                     showSoftInput();
                 }