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

Commit 95cdbd6f authored by Chong Zhang's avatar Chong Zhang Committed by Android (Google) Code Review
Browse files

Merge "Fix black wallpaper when docking a non-resizeable task"

parents f4715940 0abb20f3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2951,7 +2951,7 @@ public class WindowManagerService extends IWindowManager.Stub
            final Rect frame = new Rect(0, 0, width, height);
            final Rect insets = new Rect();
            Rect surfaceInsets = null;
            final boolean fullscreen = win != null && win.isFullscreen(width, height);
            final boolean fullscreen = win != null && win.isFrameFullscreen(displayInfo);
            final boolean freeform = win != null && win.inFreeformWorkspace();
            final boolean docked = win != null && win.inDockedWorkspace();
            if (win != null) {
@@ -5876,7 +5876,7 @@ public class WindowManagerService extends IWindowManager.Stub
                        screenshotReady = true;
                    }

                    if (ws.isFullscreen(dw, dh) && ws.isOpaqueDrawn()){
                    if (ws.isObscuringFullscreen(displayInfo)){
                        break;
                    }
                }
+14 −3
Original line number Diff line number Diff line
@@ -1250,9 +1250,20 @@ final class WindowState implements WindowManagerPolicy.WindowState {
                && (mAttachedWindow == null || !mAttachedWindow.hasMoved());
    }

    boolean isFullscreen(int screenWidth, int screenHeight) {
        return mFrame.left <= 0 && mFrame.top <= 0 &&
                mFrame.right >= screenWidth && mFrame.bottom >= screenHeight;
    boolean isObscuringFullscreen(final DisplayInfo displayInfo) {
        Task task = getTask();
        if (task != null && task.mStack != null && !task.mStack.isFullscreen()) {
            return false;
        }
        if (!isOpaqueDrawn() || !isFrameFullscreen(displayInfo)) {
            return false;
        }
        return true;
    }

    boolean isFrameFullscreen(final DisplayInfo displayInfo) {
        return mFrame.left <= 0 && mFrame.top <= 0
                && mFrame.right >= displayInfo.appWidth && mFrame.bottom >= displayInfo.appHeight;
    }

    boolean isConfigChanged() {
+1 −1
Original line number Diff line number Diff line
@@ -1106,7 +1106,7 @@ class WindowStateAnimator {
            applyDecorRect(w.mDecorFrame);
        }

        final boolean fullscreen = w.isFullscreen(displayInfo.appWidth, displayInfo.appHeight);
        final boolean fullscreen = w.isFrameFullscreen(displayInfo);
        final boolean isFreeformResizing =
                w.isDragResizing() && w.getResizeMode() == DRAG_RESIZE_MODE_FREEFORM;
        final Rect clipRect = mTmpClipRect;
+4 −6
Original line number Diff line number Diff line
@@ -661,7 +661,7 @@ class WindowSurfacePlacer {
                // Update effect.
                w.mObscured = mObscured;
                if (!mObscured) {
                    handleNotObscuredLocked(w, innerDw, innerDh);
                    handleNotObscuredLocked(w, displayInfo);
                }

                w.applyDimLayerIfNeeded();
@@ -1332,16 +1332,14 @@ class WindowSurfacePlacer {

    /**
     * @param w WindowState this method is applied to.
     * @param innerDw Width of app window.
     * @param innerDh Height of app window.
     * @param dispInfo info of the display that the window's obscuring state is checked against.
     */
    private void handleNotObscuredLocked(final WindowState w, final int innerDw, final int innerDh) {
    private void handleNotObscuredLocked(final WindowState w, final DisplayInfo dispInfo) {
        final WindowManager.LayoutParams attrs = w.mAttrs;
        final int attrFlags = attrs.flags;
        final boolean canBeSeen = w.isDisplayedLw();
        final boolean opaqueDrawn = canBeSeen && w.isOpaqueDrawn();

        if (opaqueDrawn && w.isFullscreen(innerDw, innerDh)) {
        if (canBeSeen && w.isObscuringFullscreen(dispInfo)) {
            // This window completely covers everything behind it,
            // so we want to leave all of them as undimmed (for
            // performance reasons).