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

Commit be6d2b63 authored by Evan Rosky's avatar Evan Rosky Committed by Automerger Merge Worker
Browse files

Merge "Move pip behind home stack on dismiss" into rvc-dev am: 8b13052d

Change-Id: If3c3e746771ba60c47a48f878d9504a82bb41584
parents 3c2e880d 8b13052d
Loading
Loading
Loading
Loading
+1 −13
Original line number Original line Diff line number Diff line
@@ -943,19 +943,7 @@ class ActivityStack extends Task {
        // task's ordering. However, we still need to move 'task' to back. The intention is that
        // task's ordering. However, we still need to move 'task' to back. The intention is that
        // this ends up behind the home-task so that it is made invisible; so, if the home task
        // this ends up behind the home-task so that it is made invisible; so, if the home task
        // is not a child of this, reparent 'task' to the back of the home task's actual parent.
        // is not a child of this, reparent 'task' to the back of the home task's actual parent.
        final ActivityStack home = displayArea.getOrCreateRootHomeTask();
        displayArea.positionTaskBehindHome((ActivityStack) task);
        final WindowContainer homeParent = home.getParent();
        final Task homeParentTask = homeParent != null ? homeParent.asTask() : null;
        if (homeParentTask == null) {
            ((ActivityStack) task).reparent(displayArea, false /* onTop */);
        } else if (homeParentTask == this) {
            // Apparently reparent early-outs if same stack, so we have to explicitly reorder.
            positionChildAtBottom(task);
        } else {
            task.reparent((ActivityStack) homeParentTask, false /* toTop */,
                    REPARENT_LEAVE_STACK_IN_PLACE, false /* animate */, false /* deferResume */,
                    "moveToBack");
        }
    }
    }


    // TODO: Should each user have there own stacks?
    // TODO: Should each user have there own stacks?
+1 −5
Original line number Original line Diff line number Diff line
@@ -1441,11 +1441,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
        try {
        try {
            stack.setWindowingMode(WINDOWING_MODE_UNDEFINED);
            stack.setWindowingMode(WINDOWING_MODE_UNDEFINED);
            stack.setBounds(null);
            stack.setBounds(null);
            if (toDisplay.getDisplayId() != stack.getDisplayId()) {
            toDisplay.getDefaultTaskDisplayArea().positionTaskBehindHome(stack);
                stack.reparent(toDisplay.getDefaultTaskDisplayArea(), false /* onTop */);
            } else {
                toDisplay.getDefaultTaskDisplayArea().positionStackAtBottom(stack);
            }


            // Follow on the workaround: activities are kept force hidden till the new windowing
            // Follow on the workaround: activities are kept force hidden till the new windowing
            // mode is set.
            // mode is set.
+26 −0
Original line number Original line Diff line number Diff line
@@ -765,6 +765,32 @@ final class TaskDisplayArea extends DisplayArea<ActivityStack> {
        onStackOrderChanged(stack);
        onStackOrderChanged(stack);
    }
    }


    /**
     * Moves/reparents `task` to the back of whatever container the home stack is in. This is for
     * when we just want to move a task to "the back" vs. a specific place. The primary use-case
     * is to make sure that moved-to-back apps go into secondary split when in split-screen mode.
     */
    void positionTaskBehindHome(ActivityStack task) {
        final ActivityStack home = getOrCreateRootHomeTask();
        final WindowContainer homeParent = home.getParent();
        final Task homeParentTask = homeParent != null ? homeParent.asTask() : null;
        if (homeParentTask == null) {
            // reparent throws if parent didn't change...
            if (task.getParent() == this) {
                positionStackAtBottom(task);
            } else {
                task.reparent(this, false /* onTop */);
            }
        } else if (homeParentTask == task.getParent()) {
            // Apparently reparent early-outs if same stack, so we have to explicitly reorder.
            ((ActivityStack) homeParentTask).positionChildAtBottom(task);
        } else {
            task.reparent((ActivityStack) homeParentTask, false /* toTop */,
                    Task.REPARENT_LEAVE_STACK_IN_PLACE, false /* animate */,
                    false /* deferResume */, "positionTaskBehindHome");
        }
    }

    ActivityStack getStack(int rootTaskId) {
    ActivityStack getStack(int rootTaskId) {
        for (int i = getStackCount() - 1; i >= 0; --i) {
        for (int i = getStackCount() - 1; i >= 0; --i) {
            final ActivityStack stack = getStackAt(i);
            final ActivityStack stack = getStackAt(i);