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

Commit 07543dae authored by Merissa Mitchell's avatar Merissa Mitchell
Browse files

[PiP on CD] Reduce overlap of drag region with PiP window.

Recall: http://recall/clips/7719aba5-cc34-4072-9f4f-0b5532209201

The overlap between drag-to-resize region with the PiP window is causing
single click input events on the PiP menu buttons (specifically top left
Settings and top right dismiss) to not receive input. Although this is a
general PiP on Desktop Windowing issue, it is much more prominent when a
mouse is used, and therefore more relevant to CD use case.

This CL reduces the overlap for the drag region so that input to those
buttons are not blocked.

Bug: 399196269
Test: atest WMShellUnitTests
Test: Manual - verify drag-to-resize and button clicks are WAI with
Desktop PiP
Flag: com.android.window.flags.enable_connected_displays_pip

Change-Id: Ie59351b3db8457cae3d88d0fac020100bc614de1
parent d9d26387
Loading
Loading
Loading
Loading
+11 −10
Original line number Original line Diff line number Diff line
@@ -135,8 +135,9 @@ public class PipDragToResizeHandler {
    /**
    /**
     * Check whether the current x,y coordinate is within the region in which drag-resize should
     * Check whether the current x,y coordinate is within the region in which drag-resize should
     * start.
     * start.
     * This consists of 4 small squares on the 4 corners of the PIP window, a quarter of which
     * This consists of 4 small squares on the 4 corners of the PIP window, 1/16th of which
     * overlaps with the PIP window while the rest goes outside of the PIP window.
     * overlaps with the PIP window (the overlap is not bigger so that the drag area doesn't overlap
     * with the PiP menu buttons) while the rest goes outside of the PIP window.
     * _ _           _ _
     * _ _           _ _
     * |_|_|_________|_|_|
     * |_|_|_________|_|_|
     * |_|_|         |_|_|
     * |_|_|         |_|_|
@@ -152,14 +153,14 @@ public class PipDragToResizeHandler {
            return false;
            return false;
        }
        }
        resetDragCorners();
        resetDragCorners();
        mTmpTopLeftCorner.offset(currentPipBounds.left - mDelta / 2,
        mTmpTopLeftCorner.offset(currentPipBounds.left - mDelta * 3 / 4,
                currentPipBounds.top - mDelta / 2);
                currentPipBounds.top - mDelta * 3 / 4);
        mTmpTopRightCorner.offset(currentPipBounds.right - mDelta / 2,
        mTmpTopRightCorner.offset(currentPipBounds.right - mDelta / 4,
                currentPipBounds.top - mDelta / 2);
                currentPipBounds.top - mDelta * 3 / 4);
        mTmpBottomLeftCorner.offset(currentPipBounds.left - mDelta / 2,
        mTmpBottomLeftCorner.offset(currentPipBounds.left - mDelta * 3 / 4,
                currentPipBounds.bottom - mDelta / 2);
                currentPipBounds.bottom - mDelta / 4);
        mTmpBottomRightCorner.offset(currentPipBounds.right - mDelta / 2,
        mTmpBottomRightCorner.offset(currentPipBounds.right - mDelta / 4,
                currentPipBounds.bottom - mDelta / 2);
                currentPipBounds.bottom - mDelta / 4);


        mTmpRegion.setEmpty();
        mTmpRegion.setEmpty();
        mTmpRegion.op(mTmpTopLeftCorner, Region.Op.UNION);
        mTmpRegion.op(mTmpTopLeftCorner, Region.Op.UNION);