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

Commit d02a9e95 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Get rid of some animation flickers and other bad things.

Change-Id: If7606286bf0bd01cf023d57719ccb27e39d5564c
parent d61a3a1b
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -53,19 +53,22 @@ class DimSurface {
    void show(int dw, int dh, int layer, int color) {
        if (!mDimShown) {
            if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, "  DIM " + mDimSurface + ": SHOW pos=(0,0) (" +
                    dw + "x" + dh + ")");
                    dw + "x" + dh + " layer=" + layer + ")");
            mDimShown = true;
            try {
                mLastDimWidth = dw;
                mLastDimHeight = dh;
                mDimSurface.setPosition(0, 0);
                mDimSurface.setSize(dw, dh);
                mDimSurface.setLayer(layer);
                mDimSurface.show();
            } catch (RuntimeException e) {
                Slog.w(WindowManagerService.TAG, "Failure showing dim surface", e);
            }
        } else if (mLastDimWidth != dw || mLastDimHeight != dh || mDimColor != color
                || mLayer != layer) {
            if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, "  DIM " + mDimSurface + ": pos=(0,0) (" +
                    dw + "x" + dh + " layer=" + layer + ")");
            mLastDimWidth = dw;
            mLastDimHeight = dh;
            mLayer = layer;
@@ -80,6 +83,7 @@ class DimSurface {
        if (mDimShown) {
            mDimShown = false;
            try {
                if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, "  HIDE " + mDimSurface);
                mDimSurface.hide();
            } catch (RuntimeException e) {
                Slog.w(WindowManagerService.TAG, "Illegal argument exception hiding dim surface");
+14 −7
Original line number Diff line number Diff line
@@ -7458,27 +7458,34 @@ public class WindowManagerService extends IWindowManager.Stub
                                    windowDetachedWallpaper = w;
                                }
                                if (w.mAnimation.getBackgroundColor() != 0) {
                                    if (windowAnimationBackground == null || w.mAnimLayer <
                                            windowAnimationBackground.mAnimLayer) {
                                        windowAnimationBackground = w;
                                        windowAnimationBackgroundColor =
                                                w.mAnimation.getBackgroundColor();
                                    }
                                }
                            }
                            animating = true;
                        }

                        // If this window's app token is running a detached wallpaper
                        // animation, make a note so we can ensure the wallpaper is
                        // displayed behind it.
                        if (w.mAppToken != null && w.mAppToken.animation != null) {
                        if (w.mAppToken != null && w.mAppToken.animation != null
                                && w.mAppToken.animating) {
                            if (w.mAppToken.animation.getDetachWallpaper()) {
                                windowDetachedWallpaper = w;
                            }
                            if (w.mAppToken.animation.getBackgroundColor() != 0) {
                                if (windowAnimationBackground == null || w.mAnimLayer <
                                        windowAnimationBackground.mAnimLayer) {
                                    windowAnimationBackground = w;
                                    windowAnimationBackgroundColor =
                                            w.mAppToken.animation.getBackgroundColor();
                                }
                            }
                        }

                        if (wasAnimating && !w.mAnimating && mWallpaperTarget == w) {
                            wallpaperMayChange = true;