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

Commit 13a9b16d authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Only place new task in focus stack if it is full screen stack.

The fullscreen stack is the only stack that can contain any task
regardless of if the task is resizeable or not. So, we don't want
to place any random new task in a non-fullscreen stack that has
focus as you can end up with issue like a non-resizeable task
ending up in the freeform stack and gets resized and the window
decor.

Bug: 23626353
Change-Id: Id2f151449f612b4f81ff85b42c375254871f6ec2
parent 53b06950
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -1803,8 +1803,11 @@ public final class ActivityStackSupervisor implements DisplayListener {
                return container.mStack;
            }

            if (mFocusedStack != mHomeStack && (!newTask ||
                    mFocusedStack.mActivityContainer.isEligibleForNewTasks())) {
            // The fullscreen stack is the only stack that can contain any task regardless of if
            // the task is resizeable or not. So, we let the task go in the fullscreen task if it
            // is the focus stack.
            if (mFocusedStack.mStackId == FULLSCREEN_WORKSPACE_STACK_ID
                    && (!newTask || mFocusedStack.mActivityContainer.isEligibleForNewTasks())) {
                if (DEBUG_FOCUS || DEBUG_STACK) Slog.d(TAG_FOCUS,
                        "computeStackFocus: Have a focused stack=" + mFocusedStack);
                return mFocusedStack;
@@ -1823,7 +1826,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
            }

            // If there is no suitable dynamic stack then we figure out which static stack to use.
            int stackId = task != null ? task.getLaunchStackId() :
            final int stackId = task != null ? task.getLaunchStackId() :
                        bounds != null ? FREEFORM_WORKSPACE_STACK_ID :
                                         FULLSCREEN_WORKSPACE_STACK_ID;
            stack = getStack(stackId, CREATE_IF_NEEDED, ON_TOP);