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

Commit f3b72c7b authored by Robert Carr's avatar Robert Carr
Browse files

Transform app animator crop to child window space.

The AppAnimator will not know about child windows
relative offsets to the containing frame and so
will express crops in the wrong coordinate space.

Bug: 25986646
Change-Id: I3af291aa60455b753c2e61d4eebb77ace902ff15
parent 1c609e1a
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -655,8 +655,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
        }
        }


        if (mInsetFrame.isEmpty()  && (fullscreenTask
        if (mInsetFrame.isEmpty()  && (fullscreenTask
                || (isChildWindow() && (mAttrs.privateFlags
                || layoutInParentFrame())) {
                        & PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME) != 0))) {
            // We use the parent frame as the containing frame for fullscreen and child windows
            // We use the parent frame as the containing frame for fullscreen and child windows
            mContainingFrame.set(pf);
            mContainingFrame.set(pf);
            mDisplayFrame.set(df);
            mDisplayFrame.set(df);
@@ -2595,6 +2594,10 @@ final class WindowState implements WindowManagerPolicy.WindowState {
        return mAttachedWindow != null;
        return mAttachedWindow != null;
    }
    }


    boolean layoutInParentFrame() {
        return isChildWindow() && (mAttrs.privateFlags & PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME) != 0;
    }

    void setReplacing(boolean animate) {
    void setReplacing(boolean animate) {
        if ((mAttrs.privateFlags & PRIVATE_FLAG_WILL_NOT_REPLACE_ON_RELAUNCH) != 0
        if ((mAttrs.privateFlags & PRIVATE_FLAG_WILL_NOT_REPLACE_ON_RELAUNCH) != 0
                || mAttrs.type == TYPE_APPLICATION_STARTING) {
                || mAttrs.type == TYPE_APPLICATION_STARTING) {
+11 −0
Original line number Original line Diff line number Diff line
@@ -994,6 +994,17 @@ class WindowStateAnimator {
                    if (appTransformation.hasClipRect()) {
                    if (appTransformation.hasClipRect()) {
                        mClipRect.set(appTransformation.getClipRect());
                        mClipRect.set(appTransformation.getClipRect());
                        mHasClipRect = true;
                        mHasClipRect = true;
                        // The app transformation clip will be in the coordinate space of the main
                        // activity window, which the animation correctly assumes will be placed at
                        // (0,0)+(insets) relative to the containing frame. This isn't necessarily
                        // true for child windows though which can have an arbitrary frame position
                        // relative to their containing frame. We need to offset the difference
                        // between the containing frame as used to calculate the crop and our
                        // bounds to compensate for this.
                        if (mWin.isChildWindow() && mWin.layoutInParentFrame()) {
                            mClipRect.offset( (mWin.mContainingFrame.left - mWin.mFrame.left),
                                    mWin.mContainingFrame.top - mWin.mFrame.top );
                        }
                    }
                    }
                }
                }
                if (screenAnimation) {
                if (screenAnimation) {