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

Commit 84b0574c authored by Robert Carr's avatar Robert Carr Committed by Rob Carr
Browse files

Prevent SurfaceView flash while resizing.

We need to make sure we do not preserve
and destroy attached windows when entering
drag resize as we will not swap these windows
to the big surface. On a similar note,
we need to make sure we do not hide child windows
when destroying the parent window for preservation.

Change-Id: I98e02f08d0ea2d5f0032ec7691e865c536df19c6
parent 5e7fda2e
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2860,7 +2860,11 @@ public class WindowManagerService extends IWindowManager.Stub
        // notifying the client to render to with an offset from the surface's top-left.
        if (win.isDragResizeChanged()) {
            win.setDragResizing();
            if (win.mHasSurface) {
            // 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 
            // will keep their surface and its size may change over time.
            if (win.mHasSurface && win.mAttachedWindow == null) {
                winAnimator.preserveSurfaceLocked();
                result |= WindowManagerGlobal.RELAYOUT_RES_FIRST_TIME;
            }
+6 −1
Original line number Diff line number Diff line
@@ -741,7 +741,12 @@ class WindowStateAnimator {

        if (mSurfaceController != null) {
            int i = mWin.mChildWindows.size();
            while (i > 0) {
            // When destroying a surface we want to make sure child windows
            // are hidden. If we are preserving the surface until redraw though
            // we intend to swap it out with another surface for resizing. In this case
            // the window always remains visible to the user and the child windows
            // should likewise remain visable.
            while (!mDestroyPreservedSurfaceUponRedraw && i > 0) {
                i--;
                WindowState c = mWin.mChildWindows.get(i);
                c.mAttachedHidden = true;