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.cpp31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp
index ad141a925c..577a7905b9 100644
--- a/src/plugins/platforms/android/androidjnimain.cpp
+++ b/src/plugins/platforms/android/androidjnimain.cpp
@@ -250,6 +250,12 @@ namespace QtAndroid
value);
}
+ void notifyScrolledEvent(uint accessibilityObjectId)
+ {
+ QJNIObjectPrivate::callStaticMethod<void>(m_applicationClass, "notifyScrolledEvent", "(I)V",
+ accessibilityObjectId);
+ }
+
void notifyQtAndroidPluginRunning(bool running)
{
QJNIObjectPrivate::callStaticMethod<void>(m_applicationClass, "notifyQtAndroidPluginRunning","(Z)V", running);
@@ -677,30 +683,23 @@ static void setDisplayMetrics(JNIEnv */*env*/, jclass /*clazz*/,
jdouble xdpi, jdouble ydpi,
jdouble scaledDensity, jdouble density, jfloat refreshRate)
{
- // Android does not give us the correct screen size for immersive mode, but
- // the surface does have the right size
-
- widthPixels = qMax(widthPixels, desktopWidthPixels);
- heightPixels = qMax(heightPixels, desktopHeightPixels);
-
m_desktopWidthPixels = desktopWidthPixels;
m_desktopHeightPixels = desktopHeightPixels;
m_scaledDensity = scaledDensity;
m_density = density;
+ const QSize screenSize(widthPixels, heightPixels);
+ // available geometry always starts from top left
+ const QRect availableGeometry(0, 0, desktopWidthPixels, desktopHeightPixels);
+ const QSize physicalSize(qRound(double(widthPixels) / xdpi * 25.4),
+ qRound(double(heightPixels) / ydpi * 25.4));
+
QMutexLocker lock(&m_platformMutex);
if (!m_androidPlatformIntegration) {
- QAndroidPlatformIntegration::setDefaultDisplayMetrics(desktopWidthPixels,
- desktopHeightPixels,
- qRound(double(widthPixels) / xdpi * 25.4),
- qRound(double(heightPixels) / ydpi * 25.4),
- widthPixels,
- heightPixels);
+ QAndroidPlatformIntegration::setDefaultDisplayMetrics(
+ availableGeometry.width(), availableGeometry.height(), physicalSize.width(),
+ physicalSize.height(), screenSize.width(), screenSize.height());
} else {
- const QSize physicalSize(qRound(double(widthPixels) / xdpi * 25.4),
- qRound(double(heightPixels) / ydpi * 25.4));
- const QSize screenSize(widthPixels, heightPixels);
- const QRect availableGeometry(0, 0, desktopWidthPixels, desktopHeightPixels);
m_androidPlatformIntegration->setScreenSizeParameters(physicalSize, screenSize,
availableGeometry);
m_androidPlatformIntegration->setRefreshRate(refreshRate);