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

Commit 62ff35d2 authored by Arthur Hung's avatar Arthur Hung
Browse files

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
parent 5f937a70
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -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,12 +584,16 @@ 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);
                    if (targetDA != null) {
                        mPipInputConsumer.layout(mInputTransaction, rootTask.getBounds());
                        mPipInputConsumer.reparent(mInputTransaction, targetDA);
                        mPipInputConsumer.show(mInputTransaction, MAX_VALUE - 1);
                        mAddPipInputConsumerHandle = false;
                    }
                }
            }

            if (mAddWallpaperInputConsumerHandle) {
                if (w.mAttrs.type == TYPE_WALLPAPER && w.isVisible()) {