Merge "Layer caption container surface behind corner input region." into udc-qpr-dev

This commit is contained in:
Matt Sziklay
2023-06-20 18:42:50 +00:00
committed by Android (Google) Code Review
2 changed files with 6 additions and 5 deletions

View File

@@ -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;
@@ -435,10 +434,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;
}

View File

@@ -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) {