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

Commit d565c9a4 authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Fix split->fullscreen shortcut logic

- After some debugging, the current logic works, but we close the wrong app
- Also adjust the logic to be more readable

Test: Go to splitscreen, interact with both apps, and use the split->fullscreen shortcut to go to fullscreen. Make sure the app going to fullscreen is the last interacted one.
Fixes: 309743780
Change-Id: I811595c6af8c17de47a6d113ec495d37ee325319
parent 6b7db2b6
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -2959,13 +2959,17 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
    }

    public void goToFullscreenFromSplit() {
        boolean leftOrTop;
        if (mSideStage.isFocused()) {
            leftOrTop = (mSideStagePosition == SPLIT_POSITION_TOP_OR_LEFT);
        // If main stage is focused, toEnd = true if
        // mSideStagePosition = SPLIT_POSITION_BOTTOM_OR_RIGHT. Otherwise toEnd = false
        // If side stage is focused, toEnd = true if
        // mSideStagePosition = SPLIT_POSITION_TOP_OR_LEFT. Otherwise toEnd = false
        final boolean toEnd;
        if (mMainStage.isFocused()) {
            toEnd = (mSideStagePosition == SPLIT_POSITION_BOTTOM_OR_RIGHT);
        } else {
            leftOrTop = (mSideStagePosition == SPLIT_POSITION_BOTTOM_OR_RIGHT);
            toEnd = (mSideStagePosition == SPLIT_POSITION_TOP_OR_LEFT);
        }
        mSplitLayout.flingDividerToDismiss(!leftOrTop, EXIT_REASON_FULLSCREEN_SHORTCUT);
        mSplitLayout.flingDividerToDismiss(toEnd, EXIT_REASON_FULLSCREEN_SHORTCUT);
    }

    /** Move the specified task to fullscreen, regardless of focus state. */