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

Commit 63a35e23 authored by Filip Gruszczynski's avatar Filip Gruszczynski
Browse files

Fix minor problems when resizing/maximizing docked window.

When maximizing the transition should originate from visible bounds, so
the first frame matches what is visible to the user. When switching to
the big surface, we only need to increase the layer by one, instead of
having artificially large value. If we use the large value, it will
cause a flicker over system windows.

Also includes some cleanup, like static imports and necessary logging.

Bug: 24913915

Change-Id: I84d7594622aa639e2008c662f941edf9c20b3202
parent 679f9863
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ public final class WindowManagerGlobal {

    /**
     * The window is being resized by dragging one of the window corners,
     * in this case the surface would be fullsreen-sized. The client should
     * in this case the surface would be fullscreen-sized. The client should
     * render to the actual frame location (instead of (0,curScrollY)).
     */
    public static final int RELAYOUT_RES_DRAG_RESIZING = 0x8;
+2 −2
Original line number Diff line number Diff line
@@ -149,11 +149,11 @@ class WallpaperController {
    }

    void updateWallpaperVisibility() {
        final boolean visible = isWallpaperVisible(mWallpaperTarget);
        final DisplayContent displayContent = mWallpaperTarget.getDisplayContent();
        if (displayContent == null) {
            return;
        }
        final boolean visible = isWallpaperVisible(mWallpaperTarget);
        final DisplayInfo displayInfo = displayContent.getDisplayInfo();
        final int dw = displayInfo.logicalWidth;
        final int dh = displayInfo.logicalHeight;
@@ -205,7 +205,7 @@ class WallpaperController {
                final WindowState wallpaper = token.windows.get(j);
                final WindowStateAnimator winAnimator = wallpaper.mWinAnimator;
                if (!winAnimator.mLastHidden || wasDeferred) {
                    winAnimator.hide();
                    winAnimator.hide("hideWallpapers");
                    dispatchWallpaperVisibility(wallpaper, false);
                    final DisplayContent displayContent = wallpaper.getDisplayContent();
                    if (displayContent != null) {
+5 −4
Original line number Diff line number Diff line
@@ -2079,7 +2079,9 @@ public class WindowManagerService extends IWindowManager.Stub
            // happen, let's just simply add a window.
            return;
        }
        Rect frame = replacedWindow.mFrame;
        // We use the visible frame, because we want the animation to morph the window from what
        // was visible to the user to the final destination of the new window.
        Rect frame = replacedWindow.mVisibleFrame;
        // We treat this as if this activity was opening, so we can trigger the app transition
        // animation and piggy-back on existing transition animation infrastructure.
        mOpeningApps.add(atoken);
@@ -8527,8 +8529,7 @@ public class WindowManagerService extends IWindowManager.Stub
            final WindowStateAnimator winAnimator = w.mWinAnimator;
            boolean layerChanged = false;
            int oldLayer = w.mLayer;
            if (w.mBaseLayer == curBaseLayer || w.mIsImWindow
                    || (i > 0 && w.mIsWallpaper)) {
            if (w.mBaseLayer == curBaseLayer || w.mIsImWindow || (i > 0 && w.mIsWallpaper)) {
                curLayer += WINDOW_LAYER_MULTIPLIER;
                w.mLayer = curLayer;
            } else {
+1 −3
Original line number Diff line number Diff line
@@ -1429,9 +1429,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
                        mWinAnimator + ": " + mPolicyVisibilityAfterAnim);
            }
            mPolicyVisibility = mPolicyVisibilityAfterAnim;
            if (mDisplayContent != null) {
                mDisplayContent.layoutNeeded = true;
            }
            setDisplayLayoutNeeded();
            if (!mPolicyVisibility) {
                if (mService.mCurrentFocus == this) {
                    if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,
+9 −12
Original line number Diff line number Diff line
@@ -460,9 +460,7 @@ class WindowStateAnimator {
        if (mSurfaceController != null && mSurfaceController.hasSurface()) {
            mService.mDestroySurface.add(mWin);
            mWin.mDestroying = true;
            if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(
                mWin, "HIDE (finishExit)", null);
            hide();
            hide("finishExit");
        }
        mWin.mExiting = false;
        if (mWin.mRemoveOnExit) {
@@ -472,11 +470,11 @@ class WindowStateAnimator {
        mWallpaperControllerLocked.hideWallpapers(mWin);
    }

    void hide() {
    void hide(String reason) {
        if (!mLastHidden) {
            //dump();
            mLastHidden = true;
            mSurfaceController.hideInTransaction();
            mSurfaceController.hideInTransaction(reason);
        }
    }

@@ -537,8 +535,8 @@ class WindowStateAnimator {
        if (mDestroyPreservedSurfaceUponRedraw) {
            return;
        }
        mSurfaceController.setLayer(WINDOW_FREEZE_LAYER);

        if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(mWin, "SET FREEZE LAYER", null);
        mSurfaceController.setLayer(mAnimLayer + 1);
        mDestroyPreservedSurfaceUponRedraw = true;
        mSurfaceDestroyDeferred = true;
        destroySurfaceLocked();
@@ -1226,9 +1224,9 @@ class WindowStateAnimator {

        if (mIsWallpaper && !mWin.mWallpaperVisible) {
            // Wallpaper is no longer visible and there is no wp target => hide it.
            hide();
            hide("prepareSurfaceLocked");
        } else if (w.mAttachedHidden || !w.isOnScreen()) {
            hide();
            hide("prepareSurfaceLocked");
            mWallpaperControllerLocked.hideWallpapers(w);

            // If we are waiting for this window to handle an
@@ -1260,7 +1258,6 @@ class WindowStateAnimator {
            mLastDtDy = mDtDy;
            w.mLastHScale = w.mHScale;
            w.mLastVScale = w.mVScale;

            if (WindowManagerService.SHOW_TRANSACTIONS) WindowManagerService.logSurface(w,
                    "controller=" + mSurfaceController +
                    "alpha=" + mShownAlpha + " layer=" + mAnimLayer
Loading