diff options
| author | 2023-05-10 01:21:53 +0000 | |
|---|---|---|
| committer | 2023-05-23 17:20:32 +0000 | |
| commit | ea8bf36224b1baf6b351f7aef4eccac1f112d765 (patch) | |
| tree | 7e29389674de2770296a870b8a8112d698d76a9e /libs | |
| parent | e95c5f0548297c328767a952656b512f4ba31451 (diff) | |
Do not set a disallowedAreaForEndBounds in proto1 window decors
The disallowedAreaForEndBounds is meant to be used when another
component will handle a drag move end in that region (such as a
transition to fullscreen in desktop mode proto 2) and the positioner
does not need to finalize the bounds change with a WCT.
Proto 1 window decorations do not have another component handling
the task-moves within the status bar region, so the disallowed
area should not be set so that the positioner can finalize the bounds
correctly.
Bug: 281761492
Test: drag-move a task in freeform in proto1 into the status bar
area, release and confirm the task surface or caption is not stuck
behind the status bar.
Change-Id: Ie186cf7b2b875b8424d46b6ed661438f50e10b73
Diffstat (limited to 'libs')
2 files changed, 9 insertions, 4 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java index 15abbf298b24..d2127d7a874f 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java @@ -820,8 +820,13 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel { @NonNull DesktopModeWindowDecoration windowDecoration, @NonNull RunningTaskInfo taskInfo) { final int screenWidth = mDisplayController.getDisplayLayout(taskInfo.displayId).width(); - final Rect disallowedAreaForEndBounds = new Rect(0, 0, screenWidth, - getStatusBarHeight(taskInfo.displayId)); + final Rect disallowedAreaForEndBounds; + if (DesktopModeStatus.isProto2Enabled()) { + disallowedAreaForEndBounds = new Rect(0, 0, screenWidth, + getStatusBarHeight(taskInfo.displayId)); + } else { + disallowedAreaForEndBounds = null; + } if (!DesktopModeStatus.isVeiledResizeEnabled()) { return new FluidResizeTaskPositioner(mTaskOrganizer, windowDecoration, mDisplayController, disallowedAreaForEndBounds, mDragStartListener, diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/VeiledResizeTaskPositioner.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/VeiledResizeTaskPositioner.java index 58c78e6a5b9f..39b90218dce1 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/VeiledResizeTaskPositioner.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/VeiledResizeTaskPositioner.java @@ -55,7 +55,7 @@ public class VeiledResizeTaskPositioner implements DragPositioningCallback, private final Rect mRepositionTaskBounds = new Rect(); // If a task move (not resize) finishes in this region, the positioner will not attempt to // finalize the bounds there using WCT#setBounds - private final Rect mDisallowedAreaForEndBounds = new Rect(); + private final Rect mDisallowedAreaForEndBounds; private final Supplier<SurfaceControl.Transaction> mTransactionSupplier; private int mCtrlType; @@ -77,7 +77,7 @@ public class VeiledResizeTaskPositioner implements DragPositioningCallback, mDesktopWindowDecoration = windowDecoration; mDisplayController = displayController; mDragStartListener = dragStartListener; - mDisallowedAreaForEndBounds.set(disallowedAreaForEndBounds); + mDisallowedAreaForEndBounds = new Rect(disallowedAreaForEndBounds); mTransactionSupplier = supplier; mTransitions = transitions; } |