Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f0a3ad8 authored by Robert Carr's avatar Robert Carr
Browse files

Pinned stack animation: Prevent window preservation during animation.

When moving to the fullscreen stack, we were triggering the
resized while not drag resizing logic, causing a window preservation
in the middle of the animation.

Bug: 35396882
Test: Move skeleton pinned app between states. Verify no freezes or size jumps during animation.
Change-Id: I4a72945742241b3a039b997a8da6aba89e935346
parent 47eddecc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1483,7 +1483,7 @@ public class TaskStack extends WindowContainer<Task> implements DimLayer.DimLaye
        return StackId.hasMovementAnimations(mStackId);
    }

    public boolean getForceScaleToStack() {
    public boolean isForceScaled() {
        return mBoundsAnimating;
    }

+1 −1
Original line number Diff line number Diff line
@@ -1581,7 +1581,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            // Anyway we don't need to synchronize position and content updates for these
            // windows since they aren't at the base layer and could be moved around anyway.
            if (!computeDragResizing() && mAttrs.type == TYPE_BASE_APPLICATION &&
                    !getTask().mStack.getBoundsAnimating() && !isGoneForLayoutLw() &&
                    !mWinAnimator.isForceScaled() && !isGoneForLayoutLw() &&
                    !getTask().inPinnedWorkspace()) {
                setResizedWhileNotDragResizing(true);
            }
+13 −1
Original line number Diff line number Diff line
@@ -1318,7 +1318,7 @@ class WindowStateAnimator {
        float surfaceWidth = mSurfaceController.getWidth();
        float surfaceHeight = mSurfaceController.getHeight();

        if ((task != null && task.mStack.getForceScaleToStack()) || mForceScaleUntilResize) {
        if (isForceScaled()) {
            int hInsets = w.getAttrs().surfaceInsets.left + w.getAttrs().surfaceInsets.right;
            int vInsets = w.getAttrs().surfaceInsets.top + w.getAttrs().surfaceInsets.bottom;
            if (!mForceScaleUntilResize) {
@@ -1953,4 +1953,16 @@ class WindowStateAnimator {
            }
        }
    }

    /** The force-scaled state for a given window can persist past
     * the state for it's stack as the windows complete resizing
     * independently of one another.
     */
    boolean isForceScaled() {
        final Task task = mWin.getTask();
        if (task != null && task.mStack.isForceScaled()) {
            return true;
        }
        return mForceScaleUntilResize;
    }
}