summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android/androidjnimain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/android/androidjnimain.cpp')
-rw-r--r--src/plugins/platforms/android/androidjnimain.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp
index 9e4007b37a..8ef009041f 100644
--- a/src/plugins/platforms/android/androidjnimain.cpp
+++ b/src/plugins/platforms/android/androidjnimain.cpp
@@ -238,6 +238,11 @@ namespace QtAndroid
QJNIObjectPrivate::callStaticMethod<void>(m_applicationClass, "notifyObjectFocus","(I)V", accessibilityObjectId);
}
+ void notifyQtAndroidPluginRunning(bool running)
+ {
+ QJNIObjectPrivate::callStaticMethod<void>(m_applicationClass, "notifyQtAndroidPluginRunning","(Z)V", running);
+ }
+
jobject createBitmap(QImage img, JNIEnv *env)
{
if (!m_bitmapClass)
@@ -644,11 +649,12 @@ static void setDisplayMetrics(JNIEnv */*env*/, jclass /*clazz*/,
jint widthPixels, jint heightPixels,
jint desktopWidthPixels, jint desktopHeightPixels,
jdouble xdpi, jdouble ydpi,
- jdouble scaledDensity, jdouble density)
+ jdouble scaledDensity, jdouble density, bool forceUpdate)
{
// Android does not give us the correct screen size for immersive mode, but
// the surface does have the right size
+ bool updateDesktopSize = m_desktopWidthPixels != desktopWidthPixels;
widthPixels = qMax(widthPixels, desktopWidthPixels);
heightPixels = qMax(heightPixels, desktopHeightPixels);
@@ -669,7 +675,9 @@ static void setDisplayMetrics(JNIEnv */*env*/, jclass /*clazz*/,
m_androidPlatformIntegration->setDisplayMetrics(qRound(double(widthPixels) / xdpi * 25.4),
qRound(double(heightPixels) / ydpi * 25.4));
m_androidPlatformIntegration->setScreenSize(widthPixels, heightPixels);
- m_androidPlatformIntegration->setDesktopSize(desktopWidthPixels, desktopHeightPixels);
+ if (updateDesktopSize || forceUpdate) {
+ m_androidPlatformIntegration->setDesktopSize(desktopWidthPixels, desktopHeightPixels);
+ }
}
}
@@ -795,7 +803,7 @@ static JNINativeMethod methods[] = {
{"quitQtCoreApplication", "()V", (void *)quitQtCoreApplication},
{"terminateQt", "()V", (void *)terminateQt},
{"waitForServiceSetup", "()V", (void *)waitForServiceSetup},
- {"setDisplayMetrics", "(IIIIDDDD)V", (void *)setDisplayMetrics},
+ {"setDisplayMetrics", "(IIIIDDDDZ)V", (void *)setDisplayMetrics},
{"setSurface", "(ILjava/lang/Object;II)V", (void *)setSurface},
{"updateWindow", "()V", (void *)updateWindow},
{"updateApplicationState", "(I)V", (void *)updateApplicationState},