summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dianne Hackborn <hackbod@google.com> 2011-01-01 13:21:50 -0800
committer Dianne Hackborn <hackbod@google.com> 2011-01-01 13:32:30 -0800
commit7eab094722af54717859b7dcce3cc050f059e00b (patch)
treecb31ec7f969c946cc63e6f16c09059e2e1f0f5e0
parentf6254ba7f0e48515bca3c08bbb71f916448bf0d1 (diff)
Fix flicker issue in IME.
When IME is being moved as part of a window going away, it could flicker as it immediately moves behind the window. Fix this. Also make the default soft input mode for PopupWindow to be to not change the IME visibility, since it is a rare pop-up window that should cause your IME to close. Change-Id: I0b43e080ad012739e9a3e5842794c778c859ac1a
-rw-r--r--core/java/android/widget/PopupWindow.java2
-rw-r--r--services/java/com/android/server/WindowManagerService.java18
2 files changed, 16 insertions, 4 deletions
diff --git a/core/java/android/widget/PopupWindow.java b/core/java/android/widget/PopupWindow.java
index 591a2d47d28d..5a5b6f49f532 100644
--- a/core/java/android/widget/PopupWindow.java
+++ b/core/java/android/widget/PopupWindow.java
@@ -84,7 +84,7 @@ public class PopupWindow {
private View mPopupView;
private boolean mFocusable;
private int mInputMethodMode = INPUT_METHOD_FROM_FOCUSABLE;
- private int mSoftInputMode;
+ private int mSoftInputMode = WindowManager.LayoutParams.SOFT_INPUT_STATE_UNCHANGED;
private boolean mTouchable = true;
private boolean mOutsideTouchable = false;
private boolean mClippingEnabled = true;
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index 94ed8138522c..c33d19d706a7 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -435,7 +435,6 @@ public class WindowManagerService extends IWindowManager.Stub
// This just indicates the window the input method is on top of, not
// necessarily the window its input is going to.
WindowState mInputMethodTarget = null;
- WindowState mUpcomingInputMethodTarget = null;
boolean mInputMethodTargetWaitingAnim;
int mInputMethodAnimLayerAdjustment;
@@ -1337,7 +1336,20 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
- mUpcomingInputMethodTarget = w;
+ // Now, a special case -- if the last target's window is in the
+ // process of exiting, and is above the new target, keep on the
+ // last target to avoid flicker. Consider for example a Dialog with
+ // the IME shown: when the Dialog is dismissed, we want to keep
+ // the IME above it until it is completely gone so it doesn't drop
+ // behind the dialog or its full-screen scrim.
+ if (mInputMethodTarget != null && w != null
+ && mInputMethodTarget.isDisplayedLw()
+ && mInputMethodTarget.mExiting) {
+ if (mInputMethodTarget.mAnimLayer > w.mAnimLayer) {
+ w = mInputMethodTarget;
+ i = localmWindows.indexOf(w);
+ }
+ }
if (DEBUG_INPUT_METHOD) Slog.v(TAG, "Desired input method target="
+ w + " willMove=" + willMove);
@@ -1626,7 +1638,7 @@ public class WindowManagerService extends IWindowManager.Stub
}
imPos = tmpRemoveWindowLocked(imPos, imWin);
if (DEBUG_INPUT_METHOD) {
- Slog.v(TAG, "List after moving with new pos " + imPos + ":");
+ Slog.v(TAG, "List after removing with new pos " + imPos + ":");
logWindowList(" ");
}
imWin.mTargetAppToken = mInputMethodTarget.mAppToken;