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

Commit e8b052af authored by Matthew Ng's avatar Matthew Ng
Browse files

Fixes dock side when rotating to seascape after drag to split

Entering split screen (in portrait or landscape) using drag to top
and then rotate to seascape docks primary stack to wrong side. When
entering with drag, display content creates a stack and tries to query
dock side without setting itself into the stack which returns an invalid
dock side. The dock side is used by DockedStackDividerController to hold
the original side that the primary stack split to when
notifyDockedStackExistsChanged occurs. Fix by defering calling
notifyDockedStackExistsChanged until display content is added to the
stack.

Test: manual - drag app in overview to split and rotate CCW
Change-Id: I14f5d68ab95548ee7276c7101c5f991a5ceb69e4
Fixes: 70718233
parent e2861da8
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -454,8 +454,11 @@ public class DockedStackDividerController {
                inputMethodManagerInternal.hideCurrentInputMethod();
                mImeHideRequested = true;
            }

            // If a primary stack was just created, it will not have access to display content at
            // this point so pass it from here to get a valid dock side.
            final TaskStack stack = mDisplayContent.getSplitScreenPrimaryStackIgnoringVisibility();
            mOriginalDockedSide = stack.getDockSide();
            mOriginalDockedSide = stack.getDockSideForDisplay(mDisplayContent);
            return;
        }
        mOriginalDockedSide = DOCKED_INVALID;
+12 −4
Original line number Diff line number Diff line
@@ -1397,15 +1397,23 @@ public class TaskStack extends WindowContainer<Task> implements
        return getDockSide(getRawBounds());
    }

    int getDockSideForDisplay(DisplayContent dc) {
        return getDockSide(dc, getRawBounds());
    }

    private int getDockSide(Rect bounds) {
        if (!inSplitScreenWindowingMode()) {
        if (mDisplayContent == null) {
            return DOCKED_INVALID;
        }
        if (mDisplayContent == null) {
        return getDockSide(mDisplayContent, bounds);
    }

    private int getDockSide(DisplayContent dc, Rect bounds) {
        if (!inSplitScreenWindowingMode()) {
            return DOCKED_INVALID;
        }
        mDisplayContent.getBounds(mTmpRect);
        final int orientation = mDisplayContent.getConfiguration().orientation;
        dc.getBounds(mTmpRect);
        final int orientation = dc.getConfiguration().orientation;
        return getDockSideUnchecked(bounds, mTmpRect, orientation);
    }