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

Commit 000011d3 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Ensure we clear magnification specs on non-magnifiable containers." am:...

Merge "Ensure we clear magnification specs on non-magnifiable containers." am: b73052d9 am: 6625ced0

Change-Id: I501a7b701da888299eed773cd90a1bb17304f11d
parents 13e74b23 6625ced0
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -4807,7 +4807,11 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
        // Re-parent IME's SurfaceControl when MagnificationSpec changed.
        // Re-parent IME's SurfaceControl when MagnificationSpec changed.
        updateImeParent();
        updateImeParent();


        if (spec.scale != 1.0) {
            applyMagnificationSpec(getPendingTransaction(), spec);
            applyMagnificationSpec(getPendingTransaction(), spec);
        } else {
            clearMagnificationSpec(getPendingTransaction());
        }
        getPendingTransaction().apply();
        getPendingTransaction().apply();
    }
    }


+14 −0
Original line number Original line Diff line number Diff line
@@ -137,6 +137,8 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
     */
     */
    private boolean mCommittedReparentToAnimationLeash;
    private boolean mCommittedReparentToAnimationLeash;


    private MagnificationSpec mLastMagnificationSpec;

    WindowContainer(WindowManagerService wms) {
    WindowContainer(WindowManagerService wms) {
        mWmService = wms;
        mWmService = wms;
        mPendingTransaction = wms.mTransactionFactory.make();
        mPendingTransaction = wms.mTransactionFactory.make();
@@ -1186,6 +1188,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
        if (shouldMagnify()) {
        if (shouldMagnify()) {
            t.setMatrix(mSurfaceControl, spec.scale, 0, 0, spec.scale)
            t.setMatrix(mSurfaceControl, spec.scale, 0, 0, spec.scale)
                    .setPosition(mSurfaceControl, spec.offsetX, spec.offsetY);
                    .setPosition(mSurfaceControl, spec.offsetX, spec.offsetY);
            mLastMagnificationSpec = spec;
        } else {
        } else {
            for (int i = 0; i < mChildren.size(); i++) {
            for (int i = 0; i < mChildren.size(); i++) {
                mChildren.get(i).applyMagnificationSpec(t, spec);
                mChildren.get(i).applyMagnificationSpec(t, spec);
@@ -1193,6 +1196,17 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
        }
        }
    }
    }


    void clearMagnificationSpec(Transaction t) {
        if (mLastMagnificationSpec != null) {
            t.setMatrix(mSurfaceControl, 1, 0, 0, 1)
                .setPosition(mSurfaceControl, 0, 0);
        }
        mLastMagnificationSpec = null;
        for (int i = 0; i < mChildren.size(); i++) {
            mChildren.get(i).clearMagnificationSpec(t);
        }
    }

    void prepareSurfaces() {
    void prepareSurfaces() {
        // If a leash has been set when the transaction was committed, then the leash reparent has
        // If a leash has been set when the transaction was committed, then the leash reparent has
        // been committed.
        // been committed.