diff options
authorJon Miranda <>2017-08-24 18:30:03 (GMT)
committerJon Miranda <>2017-08-24 18:30:03 (GMT)
commita11380d37081c8232eb78bf29e704a38df3237f2 (patch)
parent86ba394ad0792d31dc9b4400ea362942413251f3 (diff)
Fix bug where mw landscape cell size is calculated incorretly.
The problem is that the height we pass to the multi-window DeviceProfile includes the top insets, so we tell widgets that the cell size height is larger than it actually is. We use Display#getSize to pass in the size of the window in multi-window mode. The docs say "the returned size may be adjusted to exclude certain system decor elememts." To ensure that system decor elements is always excluded, we take the minimum sizes of the main profile and it's multi-window variant -- since the multi-window DeviceProfile sizes are never going to be larger. Bug: 64851168 Change-Id: I274f838c54f3d01d43dc51e0ff921a6124e12cf7
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/launcher3/ b/src/com/android/launcher3/
index 150bc53..db788ed 100644
--- a/src/com/android/launcher3/
+++ b/src/com/android/launcher3/
@@ -267,6 +267,10 @@ public class DeviceProfile {
DeviceProfile getMultiWindowProfile(Context context, Point mwSize) {
+ // We take the minimum sizes of this profile and it's multi-window variant to ensure that
+ // the system decor is always excluded.
+ mwSize.set(Math.min(availableWidthPx, mwSize.x), Math.min(availableHeightPx, mwSize.y));
// In multi-window mode, we can have widthPx = availableWidthPx
// and heightPx = availableHeightPx because Launcher uses the InvariantDeviceProfiles'
// widthPx and heightPx values where it's needed.