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

Commit f3df0aaa authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Fix flicker when docking task

Bug: 28051193
Change-Id: I191c01f90c775a26fce6e6f73a0573a0be91a61f
parent f1cdf955
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -595,6 +595,12 @@ class Task implements DimLayer.DimLayerUser {
                if (win.mHasSurface && !resizingWindows.contains(win)) {
                if (win.mHasSurface && !resizingWindows.contains(win)) {
                    if (DEBUG_RESIZE) Slog.d(TAG, "resizeWindows: Resizing " + win);
                    if (DEBUG_RESIZE) Slog.d(TAG, "resizeWindows: Resizing " + win);
                    resizingWindows.add(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()) {
                if (win.isGoneForLayoutLw()) {
                    win.mResizedWhileGone = true;
                    win.mResizedWhileGone = true;
+6 −3
Original line number Original line 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
        // 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.
        // 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.setDragResizing();
            win.mResizedWhileNotDragResizing = false;
            // We can only change top level windows to the full-screen surface when
            // 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
            // 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
            // to preserve and destroy windows which are attached to another, they
@@ -9021,7 +9022,8 @@ public class WindowManagerService extends IWindowManager.Stub
                    || winAnimator.mSurfaceResized
                    || winAnimator.mSurfaceResized
                    || w.mOutsetsChanged
                    || w.mOutsetsChanged
                    || configChanged
                    || configChanged
                    || dragResizingChanged) {
                    || dragResizingChanged
                    || w.mResizedWhileNotDragResizing) {
                if (DEBUG_RESIZE || DEBUG_ORIENTATION) {
                if (DEBUG_RESIZE || DEBUG_ORIENTATION) {
                    Slog.v(TAG_WM, "Resize reasons for w=" + w + ": "
                    Slog.v(TAG_WM, "Resize reasons for w=" + w + ": "
                            + " contentInsetsChanged=" + w.mContentInsetsChanged
                            + " contentInsetsChanged=" + w.mContentInsetsChanged
@@ -9055,7 +9057,8 @@ public class WindowManagerService extends IWindowManager.Stub
                // the display until this window has been redrawn; to do that,
                // the display until this window has been redrawn; to do that,
                // we need to go through the process of getting informed by the
                // we need to go through the process of getting informed by the
                // application when it has finished drawing.
                // 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) {
                    if (DEBUG_SURFACE_TRACE || DEBUG_ANIM || DEBUG_ORIENTATION || DEBUG_RESIZE) {
                        Slog.v(TAG_WM, "Orientation or resize start waiting for draw"
                        Slog.v(TAG_WM, "Orientation or resize start waiting for draw"
                                + ", mDrawState=DRAW_PENDING in " + w
                                + ", mDrawState=DRAW_PENDING in " + w
+7 −0
Original line number Original line Diff line number Diff line
@@ -468,6 +468,13 @@ final class WindowState implements WindowManagerPolicy.WindowState {
     */
     */
    boolean mResizedWhileGone = false;
    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(WindowManagerService service, Session s, IWindow c, WindowToken token,
           WindowState attachedWindow, int appOp, int seq, WindowManager.LayoutParams a,
           WindowState attachedWindow, int appOp, int seq, WindowManager.LayoutParams a,
           int viewVisibility, final DisplayContent displayContent) {
           int viewVisibility, final DisplayContent displayContent) {
+5 −0
Original line number Original line Diff line number Diff line
@@ -1318,6 +1318,11 @@ class WindowStateAnimator {
        final WindowState w = mWin;
        final WindowState w = mWin;
        final Task task = w.getTask();
        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);
        mTmpSize.set(w.mShownPosition.x, w.mShownPosition.y, 0, 0);
        calculateSurfaceBounds(w, w.getAttrs());
        calculateSurfaceBounds(w, w.getAttrs());