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

Commit 477e7206 authored by Chong Zhang's avatar Chong Zhang
Browse files

Apply stack crop to docked stack during animation

If device goes to sleep with docked stack visible, the docked stack
will be minimized after unlock. Due to "force hide enter" animation
and the entering animation of the app itself, the app will be animating
for the initial few frames. Not applying the crop causes the app to
be seen in full briefly, then minimized.

Docked divider doesn't use a final stack bounds but changes stack
bounds continously during docked stack resize, so we can apply the
bounds even during animation.

bug: 27592767
Change-Id: I12f4eb46a95c9a7dd2147b68c362e17609a8b410
parent ff29237e
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -1219,17 +1219,17 @@ class WindowStateAnimator {
        }

        // We don't apply the stack bounds crop if:
        // 1. The window is currently animating docked mode or in freeform mode, otherwise the
        // animating window will be suddenly (docked) or for whole animation (freeform) cut off.
        // (Note that we still need to apply the crop if the task being docked is non-resizeable,
        // in which case the task is running in fullscreen size but cropped to stack bounds.)
        // 1. The window is currently animating in freeform mode, otherwise the animating window
        // will be suddenly (docked) or for whole animation (freeform) cut off.
        // 2. The window that is being replaced during animation, because it was living in a
        // different stack. If we suddenly crop it to the new stack bounds, it might get cut off.
        // We don't want it to happen, so we let it ignore the stack bounds until it gets removed.
        // The window that will replace it will abide them.
        if (isAnimating() && (w.mWillReplaceWindow
                || (w.inDockedWorkspace() && task.isResizeable())
                || w.inFreeformWorkspace())) {
        // TODO: identify animations where we don't want to apply docked stack crop to the docked
        //       task. For example, if the app is going from freeform to docked mode, we may not
        //       want to apply the crop during the animation, since it will make the app appear
        //       cropped prematurely.
        if (isAnimating() && (w.mWillReplaceWindow || w.inFreeformWorkspace())) {
            return;
        }