Skip to content

Commit a91047f

Browse files
John SpurlockAndroid (Google) Code Review
authored andcommitted
Merge "NavBar: Don't resize in portrait docks when HDMI connected." into jb-dev
2 parents cee7203 + b30cd0a commit a91047f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2278,7 +2278,12 @@ public void beginLayoutLw(int displayWidth, int displayHeight, int displayRotati
22782278
// It's a system nav bar or a portrait screen; nav bar goes on bottom.
22792279
int top = displayHeight - mNavigationBarHeightForRotation[displayRotation];
22802280
if (mHdmiPlugged) {
2281-
if (top > mExternalDisplayHeight) {
2281+
// Move the nav bar up if the external display is the same aspect ratio
2282+
// but shorter. This avoids clipping on the external display.
2283+
boolean sameAspect = mExternalDisplayHeight > 0 && displayHeight > 0
2284+
&& ((float) mExternalDisplayWidth / mExternalDisplayHeight > 1)
2285+
== ((float) displayWidth / displayHeight > 1);
2286+
if (sameAspect && top > mExternalDisplayHeight) {
22822287
top = mExternalDisplayHeight;
22832288
}
22842289
}

0 commit comments

Comments
 (0)