From 57b13e327fe1d98981c29f6a2a32b07417283849 Mon Sep 17 00:00:00 2001 From: Jerry Chang Date: Sat, 1 May 2021 01:10:37 +0800 Subject: [PATCH] Make sure to reorder side stage above main stage to prevent flicker Always reorder side stage to the top whenever there's a child task appeared in side stage. This is needed to prevent main stage occludes newly launched task in side stage and causing itself flipping between fullscreen and multi-window windowing mode. Fix: 186614428 Bug: 169271875 Test: enter staged split by launching task with adjacent flag, screen won't flicker Change-Id: I9176a97439d687bbc7b0bf2dd9ddfdaecacfa455 --- .../com/android/wm/shell/splitscreen/StageCoordinator.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java index efaa2696cbebd..f7160e55012c3 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java @@ -452,6 +452,10 @@ class StageCoordinator implements SplitLayout.LayoutChangeListener, // Make sure the main stage is active. mMainStage.activate(getMainStageBounds(), wct); mSideStage.setBounds(getSideStageBounds(), wct); + // Reorder side stage to the top whenever there's a new child task appeared in side + // stage. This is needed to prevent main stage occludes side stage and makes main stage + // flipping between fullscreen and multi-window windowing mode. + wct.reorder(mSideStage.mRootTaskInfo.token, true); mTaskOrganizer.applyTransaction(wct); } }