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

Commit 6b667d55 authored by Vishnu Nair's avatar Vishnu Nair Committed by Android (Google) Code Review
Browse files

Merge "[wm] Adjust freeform header not to be overlapped with stable insets" into qt-dev

parents 0709e37e 84b30d2c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -450,6 +450,11 @@ class TaskPositioner implements IBinder.DeathRecipient {

        // This is a moving or scrolling operation.
        mTask.mStack.getDimBounds(mTmpRect);
        // If a target window is covered by system bar, there is no way to move it again by touch.
        // So we exclude them from stack bounds. and then it will be shown inside stable area.
        Rect stableBounds = new Rect();
        mDisplayContent.getStableRect(stableBounds);
        mTmpRect.intersect(stableBounds);

        int nX = (int) x;
        int nY = (int) y;
+19 −1
Original line number Diff line number Diff line
@@ -2209,9 +2209,27 @@ class TaskRecord extends ConfigurationContainer {
            // by policy, make sure the window remains within parent somewhere
            final float density =
                    ((float) newParentConfig.densityDpi) / DisplayMetrics.DENSITY_DEFAULT;
            fitWithinBounds(outOverrideBounds, newParentConfig.windowConfiguration.getBounds(),
            final Rect parentBounds =
                    new Rect(newParentConfig.windowConfiguration.getBounds());
            final ActivityDisplay display = mStack.getDisplay();
            if (display != null && display.mDisplayContent != null) {
                // If a freeform window moves below system bar, there is no way to move it again
                // by touch. Because its caption is covered by system bar. So we exclude them
                // from stack bounds. and then caption will be shown inside stable area.
                final Rect stableBounds = new Rect();
                display.mDisplayContent.getStableRect(stableBounds);
                parentBounds.intersect(stableBounds);
            }

            fitWithinBounds(outOverrideBounds, parentBounds,
                    (int) (density * WindowState.MINIMUM_VISIBLE_WIDTH_IN_DP),
                    (int) (density * WindowState.MINIMUM_VISIBLE_HEIGHT_IN_DP));

            // Prevent to overlap caption with stable insets.
            final int offsetTop = parentBounds.top - outOverrideBounds.top;
            if (offsetTop > 0) {
                outOverrideBounds.offset(0, offsetTop);
            }
        }
        computeConfigResourceOverrides(getResolvedOverrideConfiguration(), newParentConfig);
    }