mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
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
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user