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

Commit 35a6848f authored by Winson Chung's avatar Winson Chung
Browse files

Workaround for flicker between handoff from app to task view

- Defer finishing the recents animation for a couple frames until the
  frame has likely been pushed to sf and drawn, otherwise the reparenting
  of the app surface may happen before the task view is visible in
  Launcher.

Bug: 111299394
Test: Swipe up repeatedly from an app
Change-Id: I627dc085a5e376436b2b8eb5841c45fd36deff42
parent f912bd95
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -882,8 +882,21 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> {
                // new thumbnail
                finishTransitionPosted = new WindowCallbacksCompat(taskView) {

                    // The number of frames to defer until we actually finish the animation
                    private int mDeferFrameCount = 2;

                    @Override
                    public void onPostDraw(Canvas canvas) {
                        if (mDeferFrameCount > 0) {
                            mDeferFrameCount--;
                            // Workaround, detach and reattach to invalidate the root node for
                            // another draw
                            detach();
                            attach();
                            taskView.invalidate();
                            return;
                        }

                        setStateOnUiThread(STATE_SCREENSHOT_CAPTURED);
                        detach();
                    }