Android: Remove check for screen/window ascpect ratio mismatch
The check was re-introduced in 7a9bc220c70745cd3689d51cd131efde86f078d7 and moved to QtRootLayout in 6ff88f97a6d24d1098583421161f8f903f9dafde. It introduces an issue where the resizing of the application window does not work if the its aspect ratio is different from the screen's aspect ratio. Fixes: QTBUG-126122 Pick-to: 6.7 6.7.2 Change-Id: Id6d26b247b9ca7a8d0e89e1fdea2d77db12a6cfe Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit a6b78e6f4dbbf688fc0b1d1487b86890b149d323) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
3b1d343215
commit
52bb40a088
@ -32,25 +32,6 @@ class QtRootLayout extends QtLayout
|
|||||||
if (activity == null)
|
if (activity == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DisplayMetrics realMetrics = new DisplayMetrics();
|
|
||||||
Display display = (Build.VERSION.SDK_INT < Build.VERSION_CODES.R)
|
|
||||||
? activity.getWindowManager().getDefaultDisplay()
|
|
||||||
: activity.getDisplay();
|
|
||||||
|
|
||||||
if (display == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
display.getRealMetrics(realMetrics);
|
|
||||||
if ((realMetrics.widthPixels > realMetrics.heightPixels) != (w > h)) {
|
|
||||||
// This is an intermediate state during display rotation.
|
|
||||||
// The new size is still reported for old orientation, while
|
|
||||||
// realMetrics contain sizes for new orientation. Setting
|
|
||||||
// such parameters will produce inconsistent results, so
|
|
||||||
// we just skip them.
|
|
||||||
// We will have another onSizeChanged() with normal values
|
|
||||||
// a bit later.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
QtDisplayManager.setApplicationDisplayMetrics(activity, w, h);
|
QtDisplayManager.setApplicationDisplayMetrics(activity, w, h);
|
||||||
QtDisplayManager.handleOrientationChanges(activity);
|
QtDisplayManager.handleOrientationChanges(activity);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user