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

Commit 24aac8ad authored by Chong Zhang's avatar Chong Zhang Committed by Android (Google) Code Review
Browse files

Merge "Apply temp inset bounds to child window if it's not empty" into nyc-dev

parents 82746b0a ae35fef6
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -645,15 +645,23 @@ final class WindowState implements WindowManagerPolicy.WindowState {
        final boolean fullscreenTask = !inMultiWindowMode();
        final boolean windowsAreFloating = task != null && task.isFloating();

        if (fullscreenTask || (isChildWindow()
                && (mAttrs.privateFlags & PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME) != 0)) {
        // If the task has temp inset bounds set, we have to make sure all its windows uses
        // the temp inset frame. Otherwise different display frames get applied to the main
        // window and the child window, making them misaligned.
        if (fullscreenTask) {
            mInsetFrame.setEmpty();
        } else {
            task.getTempInsetBounds(mInsetFrame);
        }

        if (mInsetFrame.isEmpty()  && (fullscreenTask
                || (isChildWindow() && (mAttrs.privateFlags
                        & PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME) != 0))) {
            // We use the parent frame as the containing frame for fullscreen and child windows
            mContainingFrame.set(pf);
            mDisplayFrame.set(df);
            mInsetFrame.setEmpty();
        } else {
            task.getBounds(mContainingFrame);
            task.getTempInsetBounds(mInsetFrame);
            if (mAppToken != null && !mAppToken.mFrozenBounds.isEmpty()) {

                // If the bounds are frozen, we still want to translate the window freely and only
+0 −2
Original line number Diff line number Diff line
@@ -711,8 +711,6 @@ class WindowStateAnimator {

        // Start a new transaction and apply position & offset.
        final int layerStack = w.getDisplayContent().getDisplay().getLayerStack();
        if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(w,
                "POS " + mTmpSize.left + ", " + mTmpSize.top, false);
        mSurfaceController.setPositionAndLayer(mTmpSize.left, mTmpSize.top, layerStack, mAnimLayer);
        mLastHidden = true;

+5 −0
Original line number Diff line number Diff line
@@ -119,6 +119,8 @@ class WindowSurfaceController {
            mSurfaceY = top;

            try {
                if (SHOW_TRANSACTIONS) logSurface(
                        "POS (setPositionAndLayer) @ (" + left + "," + top + ")", null);
                mSurfaceControl.setPosition(left, top);
                mSurfaceControl.setLayerStack(layerStack);

@@ -205,6 +207,9 @@ class WindowSurfaceController {
            mSurfaceY = top;

            try {
                if (SHOW_TRANSACTIONS) logSurface(
                        "POS (setPositionInTransaction) @ (" + left + "," + top + ")", null);

                mSurfaceControl.setPosition(left, top);
            } catch (RuntimeException e) {
                Slog.w(TAG, "Error positioning surface of " + this