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

Commit a7f9b84b authored by Adrian Roos's avatar Adrian Roos
Browse files

Cutout: Fix issues with PopupWindows

Fixes a problem where popup windows were treated as fullscreen to avoid
the cutout, messing up the positioning relative to their parent. Fixed
by treating popups that lay out within the frame of their parent as already
avoiding the cutout.

Change-Id: Ia7365c7836c28ea956b6236a005e426b634df8ca
Fixes: 72965959
Test: Open Gmail, compose new message, autocomplete dialog is properly aligned
Test: Select text, selection handles are properly aligned
Test: Select text, copy/past popup is properly aligned
parent ee3a2ba9
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -5226,9 +5226,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        }

        final int cutoutMode = attrs.layoutInDisplayCutoutMode;
        final boolean attachedInParent = attached != null && !layoutInScreen;
        // Ensure that windows with a DEFAULT or NEVER display cutout mode are laid out in
        // the cutout safe zone.
        if (cutoutMode != LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS) {
        // Windows that are attached to a parent and laid out in said parent are already avoiding
        // the cutout according to that parent and don't need to be further constrained.
        if (cutoutMode != LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS && !attachedInParent) {
            final Rect displayCutoutSafeExceptMaybeTop = mTmpRect;
            displayCutoutSafeExceptMaybeTop.set(displayFrames.mDisplayCutoutSafe);
            if (layoutInScreen && layoutInsetDecor && !requestedFullscreen