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

Commit 9032b8d9 authored by Evan Rosky's avatar Evan Rosky
Browse files

Finish converting tile usage to task-org

Right now, there are situations where WM and task-org are fighting
over surface positioning. Most notably this was visible when starting
the first minimized task.

This finishes making the tiles (root tasks) be de-facto task-org'd
tasks. This improves a lot of glitchiness in split-screen.

Bug: 149952263
Bug: 150954849
Test: launch an app into split-screen primary and notice that it
      glitches less.
Change-Id: I727da6cf6c9b887cb698fe1b764f3835d566dec1
parent 24a1ea3f
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -649,14 +649,6 @@ class ActivityStack extends Task {

        if (prevWindowingMode != getWindowingMode()) {
            mDisplayContent.onStackWindowingModeChanged(this);

            if (inSplitScreenSecondaryWindowingMode()) {
                // When the stack is resized due to entering split screen secondary, offset the
                // windows to compensate for the new stack position.
                forAllWindows(w -> {
                    w.mWinAnimator.setOffsetPositionForStackResize(true);
                }, true);
            }
        }

        final DisplayContent display = getDisplay();
@@ -3883,9 +3875,10 @@ class ActivityStack extends Task {
            return;
        }
        if (mTile != null) {
            reparentSurfaceControl(getPendingTransaction(), mTile.getSurfaceControl());
            // don't use reparentSurfaceControl because we need to bypass taskorg check
            mSurfaceAnimator.reparent(getPendingTransaction(), mTile.getSurfaceControl());
        } else if (mTile == null && origTile != null) {
            reparentSurfaceControl(getPendingTransaction(), getParentSurfaceControl());
            mSurfaceAnimator.reparent(getPendingTransaction(), getParentSurfaceControl());
        }
    }

+6 −6
Original line number Diff line number Diff line
@@ -3970,12 +3970,12 @@ class Task extends WindowContainer<WindowContainer> {

    boolean isControlledByTaskOrganizer() {
        final Task rootTask = getRootTask();
        return rootTask == this && rootTask.mTaskOrganizer != null
                // TODO(task-hierarchy): Figure out how to control nested tasks.
                // For now, if this is in a tile let WM drive.
                && !(rootTask instanceof TaskTile)
                && !(rootTask instanceof ActivityStack
                        && ((ActivityStack) rootTask).getTile() != null);
        // if the rootTask is a "child" of a tile, then don't consider it a root task.
        // TODO: remove this along with removing tile.
        if (((ActivityStack) rootTask).getTile() != null) {
            return false;
        }
        return rootTask == this && rootTask.mTaskOrganizer != null;
    }

    @Override