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

Commit 5e707112 authored by Jorge Gil's avatar Jorge Gil Committed by Android (Google) Code Review
Browse files

Merge "Set task surface crop to null when in fullscreen mode" into main

parents 8f5885e9 3a2b99be
Loading
Loading
Loading
Loading
+18 −4
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.wm.shell.windowdecor;

import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;

import android.app.ActivityManager.RunningTaskInfo;
import android.content.Context;
@@ -220,6 +221,8 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer>
        final Resources resources = mDecorWindowContext.getResources();
        final Configuration taskConfig = mTaskInfo.getConfiguration();
        final Rect taskBounds = taskConfig.windowConfiguration.getBounds();
        final boolean isFullscreen = taskConfig.windowConfiguration.getWindowingMode()
                == WINDOWING_MODE_FULLSCREEN;
        outResult.mWidth = taskBounds.width();
        outResult.mHeight = taskBounds.height();

@@ -279,13 +282,24 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer>
        mTmpColor[1] = (float) Color.green(backgroundColorInt) / 255.f;
        mTmpColor[2] = (float) Color.blue(backgroundColorInt) / 255.f;
        final Point taskPosition = mTaskInfo.positionInParent;
        startT.setWindowCrop(mTaskSurface, outResult.mWidth, outResult.mHeight)
                .setShadowRadius(mTaskSurface, shadowRadius)
        if (isFullscreen) {
            // Setting the task crop to the width/height stops input events from being sent to
            // some regions of the app window. See b/300324920
            // TODO(b/296921174): investigate whether crop/position needs to be set by window
            // decorations at all when transition handlers are already taking ownership of the task
            // surface placement/crop, especially when in fullscreen where tasks cannot be
            // drag-resized by the window decoration.
            startT.setWindowCrop(mTaskSurface, null);
            finishT.setWindowCrop(mTaskSurface, null);
        } else {
            startT.setWindowCrop(mTaskSurface, outResult.mWidth, outResult.mHeight);
            finishT.setWindowCrop(mTaskSurface, outResult.mWidth, outResult.mHeight);
        }
        startT.setShadowRadius(mTaskSurface, shadowRadius)
                .setColor(mTaskSurface, mTmpColor)
                .show(mTaskSurface);
        finishT.setPosition(mTaskSurface, taskPosition.x, taskPosition.y)
                .setShadowRadius(mTaskSurface, shadowRadius)
                .setWindowCrop(mTaskSurface, outResult.mWidth, outResult.mHeight);
                .setShadowRadius(mTaskSurface, shadowRadius);
        if (mTaskInfo.getWindowingMode() == WINDOWING_MODE_FREEFORM) {
            startT.setCornerRadius(mTaskSurface, params.mCornerRadius);
            finishT.setCornerRadius(mTaskSurface, params.mCornerRadius);