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

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

Fix flicker at the end of docked stack divider animation

Because w.isDragResize() was still true but we already
cleared the flag of the divider controller that it was
resizing, there was a frame at the end of the resize
operation at which all stack surfaces were placed at 0/0,
leading to a flicker.
Fix flicker at the end of docked stack divider animation

Because w.isDragResize() was still true but we already
cleared the flag of the divider controller that it was
resizing, there was a frame at the end of the resize
operation at which all stack surfaces were placed at 0/0,
leading to a flicker.

Change-Id: I126765a31703e5405687bcc511960a41024eb652
parent 1fcbab6a
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -108,6 +108,9 @@ final class WindowState implements WindowManagerPolicy.WindowState {

    static final boolean BOUNDS_FOR_TOUCH = true;

    static final int DRAG_RESIZE_MODE_FREEFORM = 0;
    static final int DRAG_RESIZE_MODE_DOCKED_DIVIDER = 1;

    final WindowManagerService mService;
    final WindowManagerPolicy mPolicy;
    final Context mContext;
@@ -145,6 +148,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
    boolean mAttachedHidden;    // is our parent window hidden?
    boolean mWallpaperVisible;  // for wallpaper, what was last vis report?
    boolean mDragResizing;
    int mResizeMode;

    RemoteCallbackList<IWindowFocusObserver> mFocusCallbacks;

@@ -1916,6 +1920,10 @@ final class WindowState implements WindowManagerPolicy.WindowState {
        return mDragResizing != computeDragResizing();
    }

    int getResizeMode() {
        return mResizeMode;
    }

    private boolean computeDragResizing() {
        final Task task = getTask();
        if (task == null) {
@@ -1930,6 +1938,9 @@ final class WindowState implements WindowManagerPolicy.WindowState {

    void setDragResizing() {
        mDragResizing = computeDragResizing();
        mResizeMode = mDragResizing && mDisplayContent.mDividerControllerLocked.isResizing()
                ? DRAG_RESIZE_MODE_DOCKED_DIVIDER
                : DRAG_RESIZE_MODE_FREEFORM;
    }

    boolean isDragResizing() {
+3 −2
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import static com.android.server.wm.WindowManagerService.SHOW_LIGHT_TRANSACTIONS
import static com.android.server.wm.WindowManagerService.SHOW_SURFACE_ALLOC;
import static com.android.server.wm.WindowManagerService.SHOW_TRANSACTIONS;
import static com.android.server.wm.WindowManagerService.TYPE_LAYER_MULTIPLIER;
import static com.android.server.wm.WindowState.*;
import static com.android.server.wm.WindowSurfacePlacer.SET_ORIENTATION_CHANGE_COMPLETE;
import static com.android.server.wm.WindowSurfacePlacer.SET_TURN_ON_SCREEN;

@@ -1062,7 +1063,7 @@ class WindowStateAnimator {

        final boolean fullscreen = w.isFullscreen(displayInfo.appWidth, displayInfo.appHeight);
        final boolean isFreeformResizing =
                w.isDragResizing() && !mService.isDockedStackResizingLocked();
                w.isDragResizing() && w.getResizeMode() == DRAG_RESIZE_MODE_FREEFORM;
        final Rect clipRect = mTmpClipRect;
        if (isFreeformResizing) {
            // When we're doing a drag-resizing, the surface is set up to cover full screen.
@@ -1154,7 +1155,7 @@ class WindowStateAnimator {
            final DisplayInfo displayInfo = w.getDisplayInfo();

            // In freeform resize mode, put surface at 0/0.
            if (w.isDragResizing() && !mService.isDockedStackResizingLocked()) {
            if (w.isDragResizing() && w.getResizeMode() == DRAG_RESIZE_MODE_FREEFORM) {
                left = 0;
                top = 0;
            }