Merge "Fix surface crop being wrong after rotation" into udc-dev

This commit is contained in:
Mady Mellor
2023-05-09 23:56:26 +00:00
committed by Android (Google) Code Review

View File

@@ -501,11 +501,14 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener {
.show(mTaskLeash); .show(mTaskLeash);
// Also reparent on finishTransaction since the finishTransaction will reparent back // Also reparent on finishTransaction since the finishTransaction will reparent back
// to its "original" parent by default. // to its "original" parent by default.
Rect boundsOnScreen = mTaskViewBase.getCurrentBoundsOnScreen();
finishTransaction.reparent(mTaskLeash, mSurfaceControl) finishTransaction.reparent(mTaskLeash, mSurfaceControl)
.setPosition(mTaskLeash, 0, 0); .setPosition(mTaskLeash, 0, 0)
mTaskViewTransitions.updateBoundsState(this, mTaskViewBase.getCurrentBoundsOnScreen()); // 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 */); mTaskViewTransitions.updateVisibilityState(this, true /* visible */);
wct.setBounds(mTaskToken, mTaskViewBase.getCurrentBoundsOnScreen()); wct.setBounds(mTaskToken, boundsOnScreen);
} else { } else {
// The surface has already been destroyed before the task has appeared, // The surface has already been destroyed before the task has appeared,
// so go ahead and hide the task entirely // so go ahead and hide the task entirely