From 20a13047aed95d72284bcede1dab54e5c91a7bfd Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Fri, 2 Jul 2021 17:25:06 -0700 Subject: [PATCH] Use launcher surface when removing launch target Otherwise events won't be dispatched properly and window opacity will be wrong. Test: manual Fixes: 191149025 Change-Id: Ice7ea86252282c7dc1cb5925dd1bdb8cade89c08 --- .../android/launcher3/statehandlers/DepthController.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java index bb8b62db71..82582ee790 100644 --- a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java +++ b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java @@ -180,6 +180,12 @@ public class DepthController implements StateHandler, * Sets the specified app target surface to apply the blur to. */ public void setSurface(SurfaceControl surface) { + // Set launcher as the SurfaceControl when we don't need an external target anymore. + if (surface == null) { + ViewRootImpl viewRootImpl = mLauncher.getDragLayer().getViewRootImpl(); + surface = viewRootImpl != null ? viewRootImpl.getSurfaceControl() : null; + } + if (mSurface != surface) { mSurface = surface; if (surface != null) {