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

Commit c2d0acd7 authored by mattsziklay's avatar mattsziklay
Browse files

Layer caption container surface behind corner input region.

Changes layering of caption to allow input in regions occupied by
caption view. This change combined with ag/23604820 will allow for mouse input in the gap left by rounded corners.

Bug: 286461778
Test: Manual; check mouse input near caption corners in both desktop
mode and legacy caption.

Change-Id: I49d5c105b52920a3b0aead04dbc87231e73bdfca
parent d2db7f2c
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -56,7 +56,6 @@ import com.android.internal.view.BaseIWindow;
 */
class DragResizeInputListener implements AutoCloseable {
    private static final String TAG = "DragResizeInputListener";
    private static final float TOP_CORNER_PADDING = 1.5f;
    private final IWindowSession mWindowSession = WindowManagerGlobal.getWindowSession();
    private final Handler mHandler;
    private final Choreographer mChoreographer;
@@ -440,10 +439,7 @@ class DragResizeInputListener implements AutoCloseable {
            }
            double distanceFromCenter = Math.hypot(x - centerX, y - centerY);

            // TODO(b/286461778): Remove this when input in top corner gap no longer goes to header
            float cornerPadding = (ctrlType & CTRL_TYPE_TOP) != 0 ? TOP_CORNER_PADDING : 1;

            if (distanceFromCenter < mTaskCornerRadius + mResizeHandleThickness * cornerPadding
            if (distanceFromCenter < mTaskCornerRadius + mResizeHandleThickness
                    && distanceFromCenter >= mTaskCornerRadius) {
                return ctrlType;
            }
+5 −0
Original line number Diff line number Diff line
@@ -237,7 +237,12 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer>

        final int captionHeight = loadDimensionPixelSize(resources, params.mCaptionHeightId);
        final int captionWidth = taskBounds.width();

        // We use mDecorationContainerSurface to define input window for task resizing; by layering
        // it in front of mCaptionContainerSurface, we can allow it to handle input prior to
        // caption view itself, treating corner inputs as resize events rather than repositioning.
        startT.setWindowCrop(mCaptionContainerSurface, captionWidth, captionHeight)
                .setLayer(mCaptionContainerSurface, -1)
                .show(mCaptionContainerSurface);

        if (ViewRootImpl.CAPTION_ON_SHELL) {