summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mady Mellor <madym@google.com> 2023-05-09 23:56:26 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-05-09 23:56:26 +0000
commit974c3d95584c1722cbc3289c5c3a8ed9c44394c9 (patch)
tree6fa49d7d4afb693de5c4e3e3ee1465e76f566ded
parent0ea18527f7e3d437a0a2b1c7b7d1009db3b01483 (diff)
parentac1543cbfcbe33f25e4e3486c385d2b9cc596388 (diff)
Merge "Fix surface crop being wrong after rotation" into udc-dev
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTaskController.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTaskController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTaskController.java
index 3d0f3fb12ac3..1bbd3679948b 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTaskController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTaskController.java
@@ -501,11 +501,14 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener {
.show(mTaskLeash);
// Also reparent on finishTransaction since the finishTransaction will reparent back
// to its "original" parent by default.
+ Rect boundsOnScreen = mTaskViewBase.getCurrentBoundsOnScreen();
finishTransaction.reparent(mTaskLeash, mSurfaceControl)
- .setPosition(mTaskLeash, 0, 0);
- mTaskViewTransitions.updateBoundsState(this, mTaskViewBase.getCurrentBoundsOnScreen());
+ .setPosition(mTaskLeash, 0, 0)
+ // TODO: maybe once b/280900002 is fixed this will be unnecessary
+ .setWindowCrop(mTaskLeash, boundsOnScreen.width(), boundsOnScreen.height());
+ mTaskViewTransitions.updateBoundsState(this, boundsOnScreen);
mTaskViewTransitions.updateVisibilityState(this, true /* visible */);
- wct.setBounds(mTaskToken, mTaskViewBase.getCurrentBoundsOnScreen());
+ wct.setBounds(mTaskToken, boundsOnScreen);
} else {
// The surface has already been destroyed before the task has appeared,
// so go ahead and hide the task entirely