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

Commit b30cd0a8 authored by Daniel Sandler's avatar Daniel Sandler
Browse files

NavBar: Don't resize in portrait docks when HDMI connected.

The computation moving the navbar up is too drastic when a device locked
in a portrait dock is connected to a landscape external display (e.g. a TV).
Instead, only do this if the aspect ratios of the device and external display
are the same.

Bug: 6513219
Change-Id: I7cfb1096b7d1a774032d22c4b0d7eb3177766c58
parent 7b996d19
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -2278,7 +2278,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                // It's a system nav bar or a portrait screen; nav bar goes on bottom.
                int top = displayHeight - mNavigationBarHeightForRotation[displayRotation];
                if (mHdmiPlugged) {
                    if (top > mExternalDisplayHeight) {
                    // Move the nav bar up if the external display is the same aspect ratio
                    // but shorter.  This avoids clipping on the external display.
                    boolean sameAspect = mExternalDisplayHeight > 0 && displayHeight > 0
                        && ((float) mExternalDisplayWidth / mExternalDisplayHeight > 1)
                        == ((float) displayWidth / displayHeight > 1);
                    if (sameAspect && top > mExternalDisplayHeight) {
                        top = mExternalDisplayHeight;
                    }
                }