Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7eab0947 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

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
parent f6254ba7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
+15 −3
Original line number Diff line number Diff line
@@ -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;