From 2487ce70a7c28313d5e2c7a5cc8ef3d999d05ac9 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Thu, 7 Apr 2016 15:18:45 -0700 Subject: [PATCH] Do not crop children to task bounds while resizing. When we are resizing the task bounds might be smaller than the stack bounds. We don't want to clip to the task bounds here, so we use an expanded rectangle, making sure to expand it large enough for giant surfaces. Bug: 27676101 Change-Id: I1a324a474a89e4652ccd15ebd853b0b8815a48f5 --- .../core/java/com/android/server/wm/WindowState.java | 4 ++++ .../com/android/server/wm/WindowStateAnimator.java | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index ddfc022aeb3f3..c1ee79deed155 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -2353,6 +2353,10 @@ final class WindowState implements WindowManagerPolicy.WindowState { return mDragResizing; } + boolean isDockedResizing() { + return mDragResizing && getResizeMode() == DRAG_RESIZE_MODE_DOCKED_DIVIDER; + } + void dump(PrintWriter pw, String prefix, boolean dumpAll) { final TaskStack stack = getStack(); pw.print(prefix); pw.print("mDisplayId="); pw.print(getDisplayId()); diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java index 34452ee1eefa4..521a4f897bf1e 100644 --- a/services/core/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java @@ -1125,13 +1125,21 @@ class WindowStateAnimator { final int top = w.mYOffset + w.mFrame.top; // Initialize the decor rect to the entire frame. - if (w.isDragResizing() && w.getResizeMode() == DRAG_RESIZE_MODE_DOCKED_DIVIDER) { + if (w.isDockedResizing() || + (w.isChildWindow() && w.mAttachedWindow.isDockedResizing())) { // If we are resizing with the divider, the task bounds might be smaller than the // stack bounds. The system decor is used to clip to the task bounds, which we don't // want in this case in order to avoid holes. + // + // We take care to not shrink the width, for surfaces which are larger than + // the display region. Of course this area will not eventually be visible + // but if we truncate the width now, we will calculate incorrectly + // when adjusting to the stack bounds. final DisplayInfo displayInfo = w.getDisplayContent().getDisplayInfo(); - mSystemDecorRect.set(0, 0, displayInfo.logicalWidth, displayInfo.logicalHeight); + mSystemDecorRect.set(0, 0, + Math.max(width, displayInfo.logicalWidth), + Math.max(height, displayInfo.logicalHeight)); } else { mSystemDecorRect.set(0, 0, width, height); }