From 50bf96b86dc11194f4fb8a4dc97599cbe3b1eea7 Mon Sep 17 00:00:00 2001 From: Chong Zhang Date: Mon, 28 Dec 2015 11:09:01 -0800 Subject: [PATCH] Crop to stack bounds during animation if docked task is non-resizeable When a non-resizeable task is docked, it's running in fullscreen size, its visible area should always be cropped to docked stack size. Otherwise wrong size might show through during animation. bug: 26163416 Change-Id: Idcbf4b86ae0976d86a2f91e78ccc2113dd86af62 --- .../core/java/com/android/server/wm/WindowStateAnimator.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java index 01e41f4e3d1e9..381db56090485 100644 --- a/services/core/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java @@ -1182,11 +1182,14 @@ class WindowStateAnimator { // We don't apply the stack bounds crop if: // 1. The window is currently animating docked mode or in freeform mode, otherwise the // animating window will be suddenly (docked) or for whole animation (freeform) cut off. + // (Note that we still need to apply the crop if the task being docked is non-resizeable, + // in which case the task is running in fullscreen size but cropped to stack bounds.) // 2. The window that is being replaced during animation, because it was living in a // different stack. If we suddenly crop it to the new stack bounds, it might get cut off. // We don't want it to happen, so we let it ignore the stack bounds until it gets removed. // The window that will replace it will abide them. - if (isAnimating() && (w.mWillReplaceWindow || w.inDockedWorkspace() + if (isAnimating() && (w.mWillReplaceWindow + || (w.inDockedWorkspace() && task.isResizeable()) || w.inFreeformWorkspace())) { return; }