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

Commit c4dd3258 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge "Fix flicker when docking task" into nyc-dev

parents b02ffa5f f3df0aaa
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -595,6 +595,12 @@ class Task implements DimLayer.DimLayerUser {
                if (win.mHasSurface && !resizingWindows.contains(win)) {
                    if (DEBUG_RESIZE) Slog.d(TAG, "resizeWindows: Resizing " + win);
                    resizingWindows.add(win);

                    // If we are not drag resizing, force recreating of a new surface so updating
                    // the content and positioning that surface will be in sync.
                    if (!win.computeDragResizing()) {
                        win.mResizedWhileNotDragResizing = true;
                    }
                }
                if (win.isGoneForLayoutLw()) {
                    win.mResizedWhileGone = true;
+6 −3
Original line number Diff line number Diff line
@@ -2935,8 +2935,9 @@ public class WindowManagerService extends IWindowManager.Stub

        // If we're starting a drag-resize, we'll be changing the surface size as well as
        // notifying the client to render to with an offset from the surface's top-left.
        if (win.isDragResizeChanged()) {
        if (win.isDragResizeChanged() || win.mResizedWhileNotDragResizing) {
            win.setDragResizing();
            win.mResizedWhileNotDragResizing = false;
            // We can only change top level windows to the full-screen surface when
            // resizing (as we only have one full-screen surface). So there is no need
            // to preserve and destroy windows which are attached to another, they
@@ -9023,7 +9024,8 @@ public class WindowManagerService extends IWindowManager.Stub
                    || winAnimator.mSurfaceResized
                    || w.mOutsetsChanged
                    || configChanged
                    || dragResizingChanged) {
                    || dragResizingChanged
                    || w.mResizedWhileNotDragResizing) {
                if (DEBUG_RESIZE || DEBUG_ORIENTATION) {
                    Slog.v(TAG_WM, "Resize reasons for w=" + w + ": "
                            + " contentInsetsChanged=" + w.mContentInsetsChanged
@@ -9057,7 +9059,8 @@ public class WindowManagerService extends IWindowManager.Stub
                // the display until this window has been redrawn; to do that,
                // we need to go through the process of getting informed by the
                // application when it has finished drawing.
                if (w.mOrientationChanging || dragResizingChanged) {
                if (w.mOrientationChanging || dragResizingChanged
                        || w.mResizedWhileNotDragResizing) {
                    if (DEBUG_SURFACE_TRACE || DEBUG_ANIM || DEBUG_ORIENTATION || DEBUG_RESIZE) {
                        Slog.v(TAG_WM, "Orientation or resize start waiting for draw"
                                + ", mDrawState=DRAW_PENDING in " + w
+7 −0
Original line number Diff line number Diff line
@@ -468,6 +468,13 @@ final class WindowState implements WindowManagerPolicy.WindowState {
     */
    boolean mResizedWhileGone = false;

    /**
     * Indicates whether we got resized but drag resizing flag was false. In this case, we also
     * need to recreate the surface and defer surface bound updates in order to make sure the
     * buffer contents and the positioning/size stay in sync.
     */
    boolean mResizedWhileNotDragResizing;

    WindowState(WindowManagerService service, Session s, IWindow c, WindowToken token,
           WindowState attachedWindow, int appOp, int seq, WindowManager.LayoutParams a,
           int viewVisibility, final DisplayContent displayContent) {
+5 −0
Original line number Diff line number Diff line
@@ -1318,6 +1318,11 @@ class WindowStateAnimator {
        final WindowState w = mWin;
        final Task task = w.getTask();

        // We got resized, so block all updates until we got the new surface.
        if (w.mResizedWhileNotDragResizing) {
            return;
        }

        mTmpSize.set(w.mShownPosition.x, w.mShownPosition.y, 0, 0);
        calculateSurfaceBounds(w, w.getAttrs());