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

Commit 07a2ea35 authored by Rob Carr's avatar Rob Carr Committed by android-build-merger
Browse files

Merge "WindowManager: Reapply magnification spec when adding windows." into pi-dev

am: 04e1f8e6

Change-Id: I5b7ef60f615f798bf1c34cabd37c2c1dbe43e553
parents 15d55c26 04e1f8e6
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -393,6 +393,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
    /** Temporary float array to retrieve 3x3 matrix values. */
    private final float[] mTmpFloats = new float[9];

    private MagnificationSpec mMagnificationSpec;

    private final Consumer<WindowState> mUpdateWindowsForAnimator = w -> {
        WindowStateAnimator winAnimator = w.mWinAnimator;
        final AppWindowToken atoken = w.mAppToken;
@@ -3837,10 +3839,22 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
    }

    void applyMagnificationSpec(MagnificationSpec spec) {
        if (spec.scale != 1.0) {
            mMagnificationSpec = spec;
        } else {
            mMagnificationSpec = null;
        }

        applyMagnificationSpec(getPendingTransaction(), spec);
        getPendingTransaction().apply();
    }

    void reapplyMagnificationSpec() {
        if (mMagnificationSpec != null) {
            applyMagnificationSpec(getPendingTransaction(), mMagnificationSpec);
        }
    }

    @Override
    void onParentSet() {
        // Since we are the top of the SurfaceControl hierarchy here
+2 −0
Original line number Diff line number Diff line
@@ -808,6 +808,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
    void onParentSet() {
        super.onParentSet();
        setDrawnStateEvaluated(false /*evaluated*/);

        getDisplayContent().reapplyMagnificationSpec();
    }

    @Override