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

Commit e5676f02 authored by mattsziklay's avatar mattsziklay
Browse files

Use bottom stage bounds in determineHandlePosition.

Fixes an issue where bottom split task still would get a status bar
input layer due to determineHandlePosition never actually calculating a
position below the status bar. This resulted in top-split handles
opening the handle menu on bottom-split tasks.

Bug: 380879525
Bug: 343561161
Test: Manual
Flag: EXEMPT bugfix
Change-Id: I471ea378fbc3f8affd14641883e44f5ee182a3b4
parent e7b1ff94
Loading
Loading
Loading
Loading
+10 −5
Original line number Original line Diff line number Diff line
@@ -727,12 +727,17 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
        final Point position = new Point(mResult.mCaptionX, 0);
        final Point position = new Point(mResult.mCaptionX, 0);
        if (mSplitScreenController.getSplitPosition(mTaskInfo.taskId)
        if (mSplitScreenController.getSplitPosition(mTaskInfo.taskId)
                == SPLIT_POSITION_BOTTOM_OR_RIGHT
                == SPLIT_POSITION_BOTTOM_OR_RIGHT
                && mDisplayController.getDisplayLayout(mTaskInfo.displayId).isLandscape()
        ) {
        ) {
            if (mSplitScreenController.isLeftRightSplit()) {
                // If this is the right split task, add left stage's width.
                // If this is the right split task, add left stage's width.
                final Rect leftStageBounds = new Rect();
                final Rect leftStageBounds = new Rect();
                mSplitScreenController.getStageBounds(leftStageBounds, new Rect());
                mSplitScreenController.getStageBounds(leftStageBounds, new Rect());
                position.x += leftStageBounds.width();
                position.x += leftStageBounds.width();
            } else {
                final Rect bottomStageBounds = new Rect();
                mSplitScreenController.getRefStageBounds(new Rect(), bottomStageBounds);
                position.y += bottomStageBounds.top;
            }
        }
        }
        return position;
        return position;
    }
    }