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

Commit a7262a89 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Immediately start resizing when touching docked divider

Before, the surface was made full-screen only after
a certain amount of time. Now, immediately make the surface
full-screen, as soon as the divider is touched, to make
resizing much snappier.

Bug: 24507122
Change-Id: I9425785fca4e62964a959a432c80a81d346602c5
parent 253a20fa
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -287,6 +287,7 @@ public final class ViewRootImpl implements ViewParent,
    final Rect mPendingStableInsets = new Rect();
    final Rect mPendingContentInsets = new Rect();
    final Rect mPendingOutsets = new Rect();
    final Rect mPendingBackDropFrame = new Rect();
    final ViewTreeObserver.InternalInsetsInfo mLastGivenInsets
            = new ViewTreeObserver.InternalInsetsInfo();

@@ -1553,6 +1554,10 @@ public final class ViewRootImpl implements ViewParent,
                        frame.height() < desiredWindowHeight && frame.height() != mHeight));
        windowShouldResize |= mDragResizing;

        // If the backdrop frame doesn't equal to a frame, we are starting a resize operation, so
        // force it to be resized.
        windowShouldResize |= !mPendingBackDropFrame.equals(mWinFrame);

        // Determine whether to compute insets.
        // If there are no inset listeners remaining then we may still need to compute
        // insets in case the old insets were non-empty and must be reset.
@@ -1733,7 +1738,7 @@ public final class ViewRootImpl implements ViewParent,
                        & WindowManagerGlobal.RELAYOUT_RES_DRAG_RESIZING) != 0;
                if (mDragResizing != dragResizing) {
                    if (dragResizing) {
                        startDragResizing(frame);
                        startDragResizing(mPendingBackDropFrame);
                    } else {
                        // We shouldn't come here, but if we come we should end the resize.
                        endDragResizing();
@@ -3269,6 +3274,7 @@ public final class ViewRootImpl implements ViewParent,
                    mPendingStableInsets.set((Rect) args.arg6);
                    mPendingVisibleInsets.set((Rect) args.arg3);
                    mPendingOutsets.set((Rect) args.arg7);
                    mPendingBackDropFrame.set((Rect) args.arg8);

                    args.recycle();

@@ -3294,6 +3300,8 @@ public final class ViewRootImpl implements ViewParent,
                    mWinFrame.top = t;
                    mWinFrame.bottom = t + h;

                    mPendingBackDropFrame.set(mWinFrame);

                    if (mView != null) {
                        forceLayout(mView);
                    }
@@ -5679,6 +5687,7 @@ public final class ViewRootImpl implements ViewParent,
        args.arg5 = sameProcessCall ? new Rect(overscanInsets) : overscanInsets;
        args.arg6 = sameProcessCall ? new Rect(stableInsets) : stableInsets;
        args.arg7 = sameProcessCall ? new Rect(outsets) : outsets;
        args.arg8 = sameProcessCall ? new Rect(backDropFrame) : backDropFrame;
        msg.obj = args;
        mHandler.sendMessage(msg);
    }
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ public final class SomeArgs {
    public Object arg5;
    public Object arg6;
    public Object arg7;
    public Object arg8;
    public int argi1;
    public int argi2;
    public int argi3;
+3 −1
Original line number Diff line number Diff line
@@ -1878,8 +1878,10 @@ final class WindowState implements WindowManagerPolicy.WindowState {
            Configuration newConfig) throws RemoteException {
        DisplayInfo displayInfo = getDisplayInfo();
        mTmpRect.set(0, 0, displayInfo.logicalWidth, displayInfo.logicalHeight);
        boolean resizing = computeDragResizing();
        mClient.resized(frame, overscanInsets, contentInsets, visibleInsets, stableInsets,
                outsets, reportDraw, newConfig, inFreeformWorkspace() ? frame : mTmpRect);
                outsets, reportDraw, newConfig, inFreeformWorkspace() || !resizing
                         ? frame : mTmpRect);
    }

    public void registerFocusObserver(IWindowFocusObserver observer) {