diff options
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowState.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index 54b4123e54ca..993556faee7d 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -859,10 +859,12 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // If the task has temp inset bounds set, we have to make sure all its windows uses // the temp inset frame. Otherwise different display frames get applied to the main // window and the child window, making them misaligned. - if (inFullscreenContainer || isLetterboxedAppWindow()) { - mInsetFrame.setEmpty(); - } else if (task != null && isInMultiWindowMode()) { + // Otherwise we need to clear the inset frame, to avoid using a stale frame after leaving + // multi window mode. + if (task != null && isInMultiWindowMode()) { task.getTempInsetBounds(mInsetFrame); + } else { + mInsetFrame.setEmpty(); } // Denotes the actual frame used to calculate the insets and to perform the layout. When |