From 3d93897a56f24c0ccbccd64d85915ac56bfe2406 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Wed, 23 Mar 2016 23:00:59 -0700 Subject: [PATCH] Do not adjust child windows placement for fit to display. Consider the case where we have made a child windows parent and task smaller in the docked stack but the client has not yet caught up and requested a new size for the child window. In this case it is possible for the child windows requested layout to extend beyond the bounds of the available display area (in this case the containing frame). Our intended behavior is to clip this extra area, while preserving the relative offset of the child and parent window. If we apply gravity to fit within the display frame, the behavior will instead be to modify this offset in order to reduce the amount of cropped window. While this is a sensible idea for laying out fullscreen tasks, it is not helpful for windows layed out in the parent frame. Bug: 27687126 Bug: 27676101 Bug: 27601572 Change-Id: I80607a29506dc5a127ac0eab12c2aeb9450e13f6 --- services/core/java/com/android/server/wm/WindowState.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index 1695615feddab..d644526394333 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -2521,7 +2521,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { final int ph = mContainingFrame.height(); final Task task = getTask(); final boolean nonFullscreenTask = inMultiWindowMode(); - final boolean fitToDisplay = task != null && !task.isFloating(); + final boolean fitToDisplay = task != null && !task.isFloating() && !layoutInParentFrame(); float x, y; int w,h;