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

Commit f3e12ab2 authored by Les Prock's avatar Les Prock
Browse files

persist the changed position values in updateWallpaperOffsetLocked, even with...

persist the changed position values in updateWallpaperOffsetLocked, even with a null mWallpaperTarget

Change-Id: I175773f6e0b3f91c1d983857028a89b959e4e9f2
parent 1801b2c3
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -389,7 +389,16 @@ final class Session extends IWindowSession.Stub
    }

    public void setWallpaperPosition(IBinder window, float x, float y, float xStep, float yStep) {
        setWallpaperPositionOverscroll(window, x, y, xStep, yStep, -1, -1, -1, -1);
        synchronized(mService.mWindowMap) {
            long ident = Binder.clearCallingIdentity();
            try {
                mService.setWindowWallpaperPositionLocked(
                        mService.windowForClientLocked(this, window, true),
                        x, y, xStep, yStep);
            } finally {
                Binder.restoreCallingIdentity(ident);
            }
        }
    }

    /**
+28 −25
Original line number Diff line number Diff line
@@ -1983,7 +1983,7 @@ public class WindowManagerService extends IWindowManager.Stub
        int availwo = mLastWallpaperOverscrollXMax;
        int overScrollOffset = availwo > 0 ? -(int)(availwo*wpxo+0.5f) : 0;

        changed = wallpaperWin.mXOffset != offset ||
        changed = wallpaperWin.mXOffset != offset + overScrollOffset ||
                  wallpaperWin.mXOverscrollOffset != overScrollOffset;
        if (changed) {
            if (DEBUG_WALLPAPER) Slog.v(TAG, "Update wallpaper "
@@ -2011,8 +2011,7 @@ public class WindowManagerService extends IWindowManager.Stub
        float wpyo = mlastWallpaperOverscrollY >= 0 ? mlastWallpaperOverscrollY : 0.5f;
        int availho = mLastWallpaperOverscrollYMax;
        overScrollOffset = availho > 0 ? -(int)(availho*wpyo+0.5f) : 0;

        if (wallpaperWin.mYOffset != offset ||
        if (wallpaperWin.mYOffset != offset + overScrollOffset ||
            wallpaperWin.mYOverscrollOffset != overScrollOffset) {
            if (DEBUG_WALLPAPER) Slog.v(TAG, "Update wallpaper "
                    + wallpaperWin + " y: " + offset
@@ -2092,28 +2091,26 @@ public class WindowManagerService extends IWindowManager.Stub
        final int dh = displayInfo.logicalHeight;

        WindowState target = mWallpaperTarget;
        if (target != null) {
            if (target.mWallpaperX >= 0) {
        if (target != null && target.mWallpaperX >= 0) {
            mLastWallpaperX = target.mWallpaperX;
        } else if (changingTarget.mWallpaperX >= 0) {
            mLastWallpaperX = changingTarget.mWallpaperX;
        }
            if (target.mWallpaperY >= 0) {
        if (target != null && target.mWallpaperY >= 0) {
            mLastWallpaperY = target.mWallpaperY;
        } else if (changingTarget.mWallpaperY >= 0) {
            mLastWallpaperY = changingTarget.mWallpaperY;
        }
            if (target.mWallpaperXOverscroll >= 0) {
        if (target != null && target.mWallpaperXOverscroll >= 0) {
            mlastWallpaperOverscrollX = target.mWallpaperXOverscroll;
        } else if (changingTarget.mWallpaperXOverscroll >= 0) {
            mlastWallpaperOverscrollX = changingTarget.mWallpaperXOverscroll;
        }
            if (target.mWallpaperYOverscroll >= 0) {
        if (target != null && target.mWallpaperYOverscroll >= 0) {
            mlastWallpaperOverscrollY = target.mWallpaperYOverscroll;
        } else if (changingTarget.mWallpaperYOverscroll >= 0) {
            mlastWallpaperOverscrollY = changingTarget.mWallpaperYOverscroll;
        }
        }

        int curTokenIndex = mWallpaperTokens.size();
        while (curTokenIndex > 0) {
@@ -2728,7 +2725,13 @@ public class WindowManagerService extends IWindowManager.Stub

    public void setWindowWallpaperPositionLocked(WindowState window, float x, float y,
            float xStep, float yStep) {
        setWindowWallpaperPositionLocked(window, x, y, xStep, yStep, -1, -1, -1, -1);
        if (window.mWallpaperX != x || window.mWallpaperY != y) {
            window.mWallpaperX = x;
            window.mWallpaperY = y;
            window.mWallpaperXStep = xStep;
            window.mWallpaperYStep = yStep;
            updateWallpaperOffsetLocked(window, true);
        }
    }

    public void setWindowWallpaperPositionLocked(WindowState window, float x, float y,
+2 −0
Original line number Diff line number Diff line
@@ -449,6 +449,8 @@ final class WindowState implements WindowManagerPolicy.WindowState {
        mYOffset = 0;
        mXOverscrollOffset = 0;
        mYOverscrollOffset = 0;
        mWallpaperXOverscroll = 0;
        mWallpaperYOverscroll = 0;
        mWallpaperXOverscrollMax = 0;
        mWallpaperYOverscrollMax = 0;
        mLayer = 0;