}
private void updateBoundsForWindowModeChange() {
- Rect bounds = null;
+ final Rect bounds = calculateBoundsForWindowModeChange();
+
+ if (inSplitScreenSecondaryWindowingMode()) {
+ // When the stack is resized due to entering split screen secondary, offset the
+ // windows to compensate for the new stack position.
+ forAllWindows(w -> {
+ w.mWinAnimator.setOffsetPositionForStackResize(true);
+ }, true);
+ }
+
+ updateDisplayInfo(bounds);
+ updateSurfaceBounds();
+ }
+
+ private Rect calculateBoundsForWindowModeChange() {
final boolean inSplitScreenPrimary = inSplitScreenPrimaryWindowingMode();
final TaskStack splitScreenStack =
mDisplayContent.getSplitScreenPrimaryStackIgnoringVisibility();
// the docked stack occupies a dedicated region on screen, but only if the dock stack is
// not fullscreen. If it's fullscreen, it means that we are in the transition of
// dismissing it, so we must not resize this stack.
- bounds = new Rect();
+ final Rect bounds = new Rect();
mDisplayContent.getBounds(mTmpRect);
mTmpRect2.setEmpty();
if (splitScreenStack != null) {
- splitScreenStack.getRawBounds(mTmpRect2);
+ if (inSplitScreenSecondaryWindowingMode()
+ && mDisplayContent.mDividerControllerLocked.isMinimizedDock()
+ && splitScreenStack.getTopChild() != null) {
+ // If the primary split screen stack is currently minimized, then don't use the
+ // stack bounds of the minimized stack, instead, use the temporary task bounds
+ // to calculate the appropriate uniminized size of any secondary split stack
+ // TODO: Find a cleaner way for computing new stack bounds while minimized that
+ // doesn't assume the primary stack's task bounds as the temp task bounds
+ splitScreenStack.getTopChild().getBounds(mTmpRect2);
+ } else {
+ splitScreenStack.getRawBounds(mTmpRect2);
+ }
}
final boolean dockedOnTopOrLeft = mService.mDockedStackCreateMode
== SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT;
getStackDockedModeBounds(mTmpRect, bounds, mTmpRect2,
mDisplayContent.mDividerControllerLocked.getContentWidth(), dockedOnTopOrLeft);
+ return bounds;
} else if (inPinnedWindowingMode()) {
// Update the bounds based on any changes to the display info
getAnimationOrCurrentBounds(mTmpRect2);
if (mDisplayContent.mPinnedStackControllerLocked.onTaskStackBoundsChanged(
mTmpRect2, mTmpRect3)) {
- bounds = new Rect(mTmpRect3);
+ return new Rect(mTmpRect3);
}
}
-
- if (inSplitScreenSecondaryWindowingMode()) {
- // When the stack is resized due to entering split screen secondary, offset the
- // windows to compensate for the new stack position.
- forAllWindows(w -> {
- w.mWinAnimator.setOffsetPositionForStackResize(true);
- }, true);
- }
-
- updateDisplayInfo(bounds);
- updateSurfaceBounds();
+ return null;
}
/**