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

Commit 82f73a4a authored by mattsziklay's avatar mattsziklay
Browse files

Allow split apps to use fullscreen button.

When the fullscreen button is clicked in a split app's handle menu,
dismiss the other app and move the chosen app to fullscreen.

Additionally, set the windowing mode to WINDOWING_MODE_UNDEFINED rather
than WINDOWING_MODE_MULTI_WINDOW as the latter interferes with the
existing split screen -> fullscreen framework.

Bug: 306230346
Test: Manual
Change-Id: I98605c53c5aa7ef7d471ff12aed1772a84448075
parent ea23ced3
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -343,9 +343,8 @@ class DesktopTasksController(
            task.taskId
        )
        val wct = WindowContainerTransaction()
        wct.setWindowingMode(task.token, WINDOWING_MODE_MULTI_WINDOW)
        wct.setBounds(task.token, Rect())
        wct.setDensityDpi(task.token, getDefaultDensityDpi())
        addMoveToSplitChanges(wct, task)
        if (Transitions.ENABLE_SHELL_TRANSITIONS) {
            transitions.startTransition(TRANSIT_CHANGE, wct, null /* handler */)
        } else {
@@ -827,7 +826,9 @@ class DesktopTasksController(
        wct: WindowContainerTransaction,
        taskInfo: RunningTaskInfo
    ) {
        wct.setWindowingMode(taskInfo.token, WINDOWING_MODE_MULTI_WINDOW)
        // Explicitly setting multi-window at task level interferes with animations.
        // Let task inherit windowing mode once transition is complete instead.
        wct.setWindowingMode(taskInfo.token, WINDOWING_MODE_UNDEFINED)
        // The task's density may have been overridden in freeform; revert it here as we don't
        // want it overridden in multi-window.
        wct.setDensityDpi(taskInfo.token, getDefaultDensityDpi())
+10 −5
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ import com.android.wm.shell.freeform.FreeformTaskTransitionStarter;
import com.android.wm.shell.recents.RecentsTransitionHandler;
import com.android.wm.shell.recents.RecentsTransitionStateListener;
import com.android.wm.shell.splitscreen.SplitScreen;
import com.android.wm.shell.splitscreen.SplitScreen.StageType;
import com.android.wm.shell.splitscreen.SplitScreenController;
import com.android.wm.shell.sysui.KeyguardChangeListener;
import com.android.wm.shell.sysui.ShellCommandHandler;
@@ -237,7 +238,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
        mSplitScreenController = splitScreenController;
        mSplitScreenController.registerSplitScreenListener(new SplitScreen.SplitScreenListener() {
            @Override
            public void onTaskStageChanged(int taskId, int stage, boolean visible) {
            public void onTaskStageChanged(int taskId, @StageType int stage, boolean visible) {
                if (visible) {
                    DesktopModeWindowDecoration decor = mWindowDecorByTaskId.get(taskId);
                    if (decor != null && DesktopModeStatus.isEnabled()
@@ -389,10 +390,10 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
            final DesktopModeWindowDecoration decoration = mWindowDecorByTaskId.get(mTaskId);
            final int id = v.getId();
            if (id == R.id.close_window) {
                mTaskOperations.closeTask(mTaskToken);
                if (isTaskInSplitScreen(mTaskId)) {
                    RunningTaskInfo remainingTask = getOtherSplitTask(mTaskId);
                    mSplitScreenController.moveTaskToFullscreen(remainingTask.taskId);
                    mSplitScreenController.moveTaskToFullscreen(getOtherSplitTask(mTaskId).taskId);
                } else {
                    mTaskOperations.closeTask(mTaskToken);
                }
                decoration.closeMaximizeMenu();
            } else if (id == R.id.back_button) {
@@ -417,8 +418,12 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
                }
                decoration.closeHandleMenu();
            } else if (id == R.id.fullscreen_button) {
                mDesktopTasksController.ifPresent(c -> c.moveToFullscreen(mTaskId));
                decoration.closeHandleMenu();
                if (isTaskInSplitScreen(mTaskId)) {
                    mSplitScreenController.moveTaskToFullscreen(mTaskId);
                } else {
                    mDesktopTasksController.ifPresent(c -> c.moveToFullscreen(mTaskId));
                }
            } else if (id == R.id.split_screen_button) {
                decoration.closeHandleMenu();
                mDesktopTasksController.ifPresent(c -> {