diff options
| author | 2022-05-04 11:08:57 +0000 | |
|---|---|---|
| committer | 2022-05-05 09:18:55 +0000 | |
| commit | 62ff35d2abe4d2b8fb6e1aea5c96b581447cd0b8 (patch) | |
| tree | 68b16db83a4e03f85fd5daa00c2012546a5f30ca | |
| parent | 5f937a7093a6a9b8846953f00db94d955dc2a022 (diff) | |
Fix pip window can't move in recents
Just place the pip input consumer at the top display area instead of
the root task, or the recents input consumer would take all touch for
it's already put to the top of the display area.
Test: enabled pip, enter recents from app, move pip
Bug: 231419738
Change-Id: I15d765c01ebd541ee247ff12cbb3775b42ea3307
| -rw-r--r-- | services/core/java/com/android/server/wm/InputMonitor.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/wm/InputMonitor.java b/services/core/java/com/android/server/wm/InputMonitor.java index 65062e576d55..ea72e12783c3 100644 --- a/services/core/java/com/android/server/wm/InputMonitor.java +++ b/services/core/java/com/android/server/wm/InputMonitor.java @@ -573,7 +573,7 @@ final class InputMonitor { recentsAnimationController.getTargetAppDisplayArea(); if (targetDA != null) { mRecentsAnimationInputConsumer.reparent(mInputTransaction, targetDA); - mRecentsAnimationInputConsumer.show(mInputTransaction, MAX_VALUE - 1); + mRecentsAnimationInputConsumer.show(mInputTransaction, MAX_VALUE - 2); mAddRecentsAnimationInputConsumerHandle = false; } } @@ -584,10 +584,14 @@ final class InputMonitor { final Task rootTask = w.getTask().getRootTask(); mPipInputConsumer.mWindowHandle.replaceTouchableRegionWithCrop( rootTask.getSurfaceControl()); + final DisplayArea targetDA = rootTask.getDisplayArea(); // We set the layer to z=MAX-1 so that it's always on top. - mPipInputConsumer.reparent(mInputTransaction, rootTask); - mPipInputConsumer.show(mInputTransaction, MAX_VALUE - 1); - mAddPipInputConsumerHandle = false; + if (targetDA != null) { + mPipInputConsumer.layout(mInputTransaction, rootTask.getBounds()); + mPipInputConsumer.reparent(mInputTransaction, targetDA); + mPipInputConsumer.show(mInputTransaction, MAX_VALUE - 1); + mAddPipInputConsumerHandle = false; + } } } |