Android: don't call setApplicationDisplayMetrics() from QtNative
It's not immediately clear why setApplicationDisplayMetrics() is called from within QtNative.startApplication() while it's also called by QtLayout.onSizeChanged(), it seems to be a redundant call when starting the native Qt app because QtLayout takes care of it already. Task-number: QTBUG-115016 Task-number: QTBUG-118077 Change-Id: I54e8af6356226ca5f1b849ef323be9659b9db663 Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
parent
23499e7841
commit
19baa077d9
@ -38,10 +38,6 @@ public class QtDisplayManager {
|
|||||||
public static native void handleScreenRemoved(int displayId);
|
public static native void handleScreenRemoved(int displayId);
|
||||||
// screen methods
|
// screen methods
|
||||||
|
|
||||||
private static int m_widthBeforeStart = 0;
|
|
||||||
private static int m_heightBeforeStart = 0;
|
|
||||||
|
|
||||||
|
|
||||||
// Keep in sync with QtAndroid::SystemUiVisibility in androidjnimain.h
|
// Keep in sync with QtAndroid::SystemUiVisibility in androidjnimain.h
|
||||||
public static final int SYSTEM_UI_VISIBILITY_NORMAL = 0;
|
public static final int SYSTEM_UI_VISIBILITY_NORMAL = 0;
|
||||||
public static final int SYSTEM_UI_VISIBILITY_FULLSCREEN = 1;
|
public static final int SYSTEM_UI_VISIBILITY_FULLSCREEN = 1;
|
||||||
@ -269,19 +265,11 @@ public class QtDisplayManager {
|
|||||||
refreshRate = display.getRefreshRate();
|
refreshRate = display.getRefreshRate();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_widthBeforeStart = width;
|
|
||||||
m_heightBeforeStart = height;
|
|
||||||
|
|
||||||
setDisplayMetrics(maxWidth, maxHeight, insetLeft, insetTop,
|
setDisplayMetrics(maxWidth, maxHeight, insetLeft, insetTop,
|
||||||
m_widthBeforeStart, m_heightBeforeStart, xdpi, ydpi,
|
width, height, xdpi, ydpi,
|
||||||
scaledDensity, density, refreshRate);
|
scaledDensity, density, refreshRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setApplicationDisplayMetrics(Activity activity)
|
|
||||||
{
|
|
||||||
setApplicationDisplayMetrics(activity, m_widthBeforeStart, m_heightBeforeStart);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int getDisplayRotation(Activity activity) {
|
public static int getDisplayRotation(Activity activity) {
|
||||||
Display display;
|
Display display;
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
|
||||||
|
@ -291,7 +291,6 @@ public class QtNative
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
res[0] = startQtAndroidPlugin(qtParams);
|
res[0] = startQtAndroidPlugin(qtParams);
|
||||||
QtDisplayManager.setApplicationDisplayMetrics(m_activity);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
m_qtThread.post(new Runnable() {
|
m_qtThread.post(new Runnable() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user