diff options
3 files changed, 19 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/wm/WindowLayersController.java b/services/core/java/com/android/server/wm/WindowLayersController.java index f76f03fdc0fe..2437ff5a6e88 100644 --- a/services/core/java/com/android/server/wm/WindowLayersController.java +++ b/services/core/java/com/android/server/wm/WindowLayersController.java @@ -203,6 +203,12 @@ public class WindowLayersController { // the divider sometimes overlaps the app windows. layer++; layer = assignAndIncreaseLayerIfNeeded(mDockDivider, layer); + + // If we have a dock divider ensure the Input Method is above it. + if (mDockDivider != null && mService.mInputMethodWindow != null) { + layer = assignAndIncreaseLayerIfNeeded(mService.mInputMethodWindow, layer); + } + // We know that we will be animating a relaunching window in the near future, which will // receive a z-order increase. We want the replaced window to immediately receive the same // treatment, e.g. to be above the dock divider. diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index b6e25eab9952..fbe28038028b 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -1373,7 +1373,7 @@ public class WindowManagerService extends IWindowManager.Stub // needs to sit above the dock divider, so it doesn't get cut in half. We make the dock // divider be a target for IME, so this relationship can occur naturally. if (fl == 0 || fl == (FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM) - || type == TYPE_APPLICATION_STARTING || type == TYPE_DOCK_DIVIDER) { + || type == TYPE_APPLICATION_STARTING) { if (DEBUG_INPUT_METHOD) { Slog.i(TAG_WM, "isVisibleOrAdding " + w + ": " + w.isVisibleOrAdding()); if (!w.isVisibleOrAdding()) { diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index 0f515db38ed1..f0f292ace789 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -670,10 +670,18 @@ final class WindowState implements WindowManagerPolicy.WindowState { mContainingFrame.bottom = mContainingFrame.top + frozen.height(); } final WindowState imeWin = mService.mInputMethodWindow; - if (imeWin != null && imeWin.isVisibleNow() && mService.mInputMethodTarget == this - && mContainingFrame.bottom > cf.bottom) { - // IME is up and obscuring this window. Adjust the window position so it is visible. - mContainingFrame.top -= mContainingFrame.bottom - cf.bottom; + // IME is up and obscuring this window. Adjust the window position so it is visible. + if (imeWin != null && imeWin.isVisibleNow() && mService.mInputMethodTarget == this) { + if (windowsAreFloating && mContainingFrame.bottom > cf.bottom) { + // In freeform we want to move the top up directly. + // TODO: Investigate why this is cf not pf. + mContainingFrame.top -= mContainingFrame.bottom - cf.bottom; + } else if (mContainingFrame.bottom > pf.bottom) { + // But in docked we want to behave like fullscreen + // and behave as if the task were given smaller bounds + // for the purposes of layout. + mContainingFrame.bottom = pf.bottom; + } } if (windowsAreFloating) { |