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

Commit 1ee48c4f authored by Filip Gruszczynski's avatar Filip Gruszczynski
Browse files

Make stack crop be aware of the big surface during resizing.

When resizing we are using big surface, so we can't depend on the
window frame to determine how to crop it to its surface.

Change-Id: I6aaa32433c5db59dfe7ccb930a0485688e6e2503
parent ae64417b
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1431,8 +1431,14 @@ class WindowStateAnimator {
        if (appToken != null && appToken.mCropWindowsToStack && !appToken.mReplacingWindow) {
            TaskStack stack = w.getTask().mStack;
            stack.getBounds(mTmpStackBounds);
            final int frameX = w.mFrame.left + mWin.mXOffset - w.getAttrs().surfaceInsets.left;
            final int frameY = w.mFrame.top + mWin.mYOffset - w.getAttrs().surfaceInsets.top;
            // When we resize we use the big surface approach, which means we can't trust the
            // window frame bounds anymore. Instead, the window will be placed at 0, 0, but to avoid
            // hardcoding it, we use surface coordinates.
            final boolean isResizing = w.isDragResizing();
            final int frameX = isResizing ? (int) mSurfaceX :
                    w.mFrame.left + mWin.mXOffset - w.getAttrs().surfaceInsets.left;
            final int frameY = isResizing ? (int) mSurfaceY :
                    w.mFrame.top + mWin.mYOffset - w.getAttrs().surfaceInsets.top;
            // We need to do some acrobatics with surface position, because their clip region is
            // relative to the inside of the surface, but the stack bounds aren't.
            clipRect.left = Math.max(0,