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

Commit 79f268d9 authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Correctly set mContainingFrame for PopupWindows in multi-window mode

For child windows we want to base their containing frame on their
parent frame and not the task bounds.

Bug: 26255254
Change-Id: Ic211c31e69df16fdbdb7b7ba2022379c5f4a87c0
parent ad1f8e69
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -603,9 +603,14 @@ final class WindowState implements WindowManagerPolicy.WindowState {
        mHaveFrame = true;

        final Task task = getTask();
        final boolean nonFullscreenTask = task != null && !task.isFullscreen();
        final boolean fullscreenTask = task == null || task.isFullscreen();
        final boolean freeformWorkspace = task != null && task.inFreeformWorkspace();
        if (nonFullscreenTask) {

        if (fullscreenTask || isChildWindow()) {
            // We use the parent frame as the containing frame for fullscreen and child windows
            mContainingFrame.set(pf);
            mDisplayFrame.set(df);
        } else {
            task.getBounds(mContainingFrame);
            final WindowState imeWin = mService.mInputMethodWindow;
            if (imeWin != null && imeWin.isVisibleNow() && mService.mInputMethodTarget == this
@@ -623,9 +628,6 @@ final class WindowState implements WindowManagerPolicy.WindowState {
                }
            }
            mDisplayFrame.set(mContainingFrame);
        } else {
            mContainingFrame.set(pf);
            mDisplayFrame.set(df);
        }

        final int pw = mContainingFrame.width();
@@ -2276,7 +2278,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
        }

        if (nonFullscreenTask) {
            // Make sure window fits in containing frame since it is in a non-fullscreen stack as
            // Make sure window fits in containing frame since it is in a non-fullscreen task as
            // required by {@link Gravity#apply} call.
            w = Math.min(w, pw);
            h = Math.min(h, ph);