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

Commit 6e21cf44 authored by Chong Zhang's avatar Chong Zhang
Browse files

Don't hide wallpaper if surface is destroyed due to drag resizing

We change surface from small to fullscreen size upon resizing,
and keep the old surface around until first draw finishes on the
new surface. This shouln't affect wallpaper. Hiding the wallpaper
causes the background to black out on every surface mode toggle.

bug: 25439788
Change-Id: I28c957dfaf1cc7f28e28cc00d8e97b8efb905349
parent b226c153
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -8726,9 +8726,11 @@ public class WindowManagerService extends IWindowManager.Stub
                // we need to go through the process of getting informed by the
                // application when it has finished drawing.
                if (w.mOrientationChanging || dragResizingChanged) {
                    if (DEBUG_SURFACE_TRACE || DEBUG_ANIM || DEBUG_ORIENTATION) Slog.v(TAG,
                            "Orientation start waiting for draw mDrawState=DRAW_PENDING in "
                            + w + ", surfaceController " + winAnimator.mSurfaceController);
                    if (DEBUG_SURFACE_TRACE || DEBUG_ANIM || DEBUG_ORIENTATION || DEBUG_RESIZE) {
                        Slog.v(TAG, "Orientation or resize start waiting for draw"
                                + ", mDrawState=DRAW_PENDING in " + w
                                + ", surfaceController " + winAnimator.mSurfaceController);
                    }
                    winAnimator.mDrawState = WindowStateAnimator.DRAW_PENDING;
                    if (w.mAppToken != null) {
                        w.mAppToken.allDrawn = false;
+10 −2
Original line number Diff line number Diff line
@@ -752,7 +752,11 @@ class WindowStateAnimator {
                    WindowManagerService.logSurface(mWin, "DESTROY", null);
                    destroySurface();
                }
                // Don't hide wallpaper if we're deferring the surface destroy
                // because of a surface change.
                if (!(mSurfaceDestroyDeferred && mDestroyPreservedSurfaceUponRedraw)) {
                    mWallpaperControllerLocked.hideWallpapers(mWin);
                }
            } catch (RuntimeException e) {
                Slog.w(TAG, "Exception thrown when destroying Window " + this
                    + " surface " + mSurfaceController + " session " + mSession
@@ -783,8 +787,12 @@ class WindowStateAnimator {
                    WindowManagerService.logSurface(mWin, "DESTROY PENDING", e);
                }
                mPendingDestroySurface.destroyInTransaction();
                // Don't hide wallpaper if we're destroying a deferred surface
                // after a surface mode change.
                if (!mDestroyPreservedSurfaceUponRedraw) {
                    mWallpaperControllerLocked.hideWallpapers(mWin);
                }
            }
        } catch (RuntimeException e) {
            Slog.w(TAG, "Exception thrown when destroying Window "
                    + this + " surface " + mPendingDestroySurface