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

Commit ea3ff6f8 authored by Tiger Huang's avatar Tiger Huang Committed by Android (Google) Code Review
Browse files

Merge "Only update insetsHint while necessary" into sc-dev

parents c7469537 546e7ad2
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@ class InsetsSourceProvider {
    private TriConsumer<DisplayFrames, WindowState, Rect> mImeFrameProvider;
    private final Rect mImeOverrideFrame = new Rect();
    private boolean mIsLeashReadyForDispatching;
    private final Rect mLastSourceFrame = new Rect();

    private final Consumer<Transaction> mSetLeashPositionConsumer = t -> {
        if (mControl != null) {
@@ -268,12 +269,15 @@ class InsetsSourceProvider {
                    mSetLeashPositionConsumer.accept(mWin.getPendingTransaction());
                }
            }
            if (mServerVisible && !mLastSourceFrame.equals(mSource.getFrame())) {
                final Insets insetsHint = mSource.calculateInsets(
                        mWin.getBounds(), true /* ignoreVisibility */);
                if (!insetsHint.equals(mControl.getInsetsHint())) {
                    changed = true;
                    mControl.setInsetsHint(insetsHint);
                }
                mLastSourceFrame.set(mSource.getFrame());
            }
            if (changed) {
                mStateController.notifyControlChanged(mControlTarget);
            }