Bug 760087 - Don't steal focus from the findbar when Gecko IME state changes [r=cpeterson]
authorMatt Brubeck <mbrubeck@mozilla.com>
Fri, 08 Jun 2012 11:43:17 -0700
changeset 101003 0a468957ace8df7dd7d7a088eada56fdf55d2d9f
parent 101002 f72e14bf569bd5cc44147f466737fe298bdb63e7
child 101004 05da351c9b570a14899b3a902a721155c88d1dc0
push id1316
push userakeybl@mozilla.com
push dateMon, 27 Aug 2012 22:37:00 +0000
treeherdermozilla-beta@db4b09302ee2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpeterson
bugs760087
milestone16.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 760087 - Don't steal focus from the findbar when Gecko IME state changes [r=cpeterson]
mobile/android/base/GeckoInputConnection.java
mobile/android/base/gfx/LayerView.java
--- a/mobile/android/base/GeckoInputConnection.java
+++ b/mobile/android/base/GeckoInputConnection.java
@@ -1114,26 +1114,17 @@ public class GeckoInputConnection
 
             if (mReset)
                 imm.restartInput(v);
 
             if (!mEnable)
                 return;
 
             if (mIMEState != IME_STATE_DISABLED) {
-                if (!v.isFocused()) {
-                    GeckoApp.mAppContext.mMainHandler.post(new Runnable() {
-                        public void run() {
-                            v.requestFocus();
-                            imm.showSoftInput(v, 0);
-                        }
-                    });
-                } else {
-                    imm.showSoftInput(v, 0);
-                }
+                imm.showSoftInput(v, 0);
             } else {
                 imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
             }
         }
     }
 
     public void setEditable(String contents) {
         mEditable.removeSpan(this);
--- a/mobile/android/base/gfx/LayerView.java
+++ b/mobile/android/base/gfx/LayerView.java
@@ -75,16 +75,19 @@ public class LayerView extends SurfaceVi
         mInputConnectionHandler = null;
 
         setFocusable(true);
         setFocusableInTouchMode(true);
     }
 
     @Override
     public boolean onTouchEvent(MotionEvent event) {
+        if (event.getActionMasked() == MotionEvent.ACTION_DOWN)
+            requestFocus();
+
         /** We need to manually hide FormAssistPopup because it is not a regular PopupWindow. */
         if (GeckoApp.mFormAssistPopup != null)
             GeckoApp.mFormAssistPopup.hide();
 
         return mTouchEventHandler.handleEvent(event);
     }
 
     public LayerController getController() { return mController; }