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

Commit 2025bf84 authored by Robert Carr's avatar Robert Carr
Browse files

Correct exiting pip animation state.

We were using mForceScaleUntil resize to persist
the pip animation state past the Stack animation state
to give the client time to request a resize. However it now
seems the client is almost always requesting a resize before the
stack animation state ends. To account for this we need to make sure
we only reset mForceScaleUntilResize once at the beginning
of the animation and then allow the flag to be cleared ahead
of the Stack animation state.

Test: Manual.
Bug: 69065873
Change-Id: I9b5260ac984270ed62e75a4369360c0843e34d28
parent 3912a7f5
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -225,6 +225,11 @@ class WindowStateAnimator {
    // case we need to give the client a new Surface if it lays back out to a visible state.
    boolean mChildrenDetached = false;

    // Set to true after the first frame of the Pinned stack animation
    // and reset after the last to ensure we only reset mForceScaleUntilResize
    // once per animation.
    boolean mPipAnimationStarted = false;

    WindowStateAnimator(final WindowState win) {
        final WindowManagerService service = win.mService;

@@ -983,8 +988,13 @@ class WindowStateAnimator {
            // As we are in SCALING_MODE_SCALE_TO_WINDOW, SurfaceFlinger will
            // then take over the scaling until the new buffer arrives, and things
            // will be seamless.
            if (mPipAnimationStarted == false) {
                mForceScaleUntilResize = true;
                mPipAnimationStarted = true;
            }
        } else {
            mPipAnimationStarted = false;

            if (!w.mSeamlesslyRotated) {
                mSurfaceController.setPositionInTransaction(mXOffset, mYOffset, recoveringMemory);
            }