summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2022-11-01 09:34:35 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2022-11-01 09:34:35 +0000
commit1d8d9f72d2d3c7b946ce9f5d77781f915f93d12c (patch)
treedade5fd217d0e9de1d6314d4d76497d6ed4811d7
parent145e69373341112e59276d46d42f93b14bc8d3b5 (diff)
parent1bbb6923934b1e2bb4869e35a6bf7e4a0b16afa0 (diff)
Merge "Make sure surface crop is up-to-date when moving to front" into tm-qpr-dev am: 1bbb692393
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20277865 Change-Id: I6a257341b5a43745182d0f3ac0ba5c9cc5e75c44 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java
index 3de091139345..2830fa967011 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java
@@ -341,6 +341,15 @@ public class Transitions implements RemoteCallable<Transitions> {
final SurfaceControl leash = change.getLeash();
final int mode = info.getChanges().get(i).getMode();
+ if (mode == TRANSIT_TO_FRONT
+ && ((change.getStartAbsBounds().height() != change.getEndAbsBounds().height()
+ || change.getStartAbsBounds().width() != change.getEndAbsBounds().width()))) {
+ // When the window is moved to front with a different size, make sure the crop is
+ // updated to prevent it from using the old crop.
+ t.setWindowCrop(leash, change.getEndAbsBounds().width(),
+ change.getEndAbsBounds().height());
+ }
+
// Don't move anything that isn't independent within its parents
if (!TransitionInfo.isIndependent(change, info)) {
if (mode == TRANSIT_OPEN || mode == TRANSIT_TO_FRONT || mode == TRANSIT_CHANGE) {