diff options
author | Paul Olav Tvete <paul.tvete@digia.com> | 2014-08-19 15:55:32 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@digia.com> | 2014-08-20 10:07:34 +0200 |
commit | 90ed77c0448b2104d3235f9d064ad57d95f1a976 (patch) | |
tree | ea2e162cf284762d3889a44eab67a8629221a6d7 /src/plugins/platforms/android/androidjnimain.cpp | |
parent | b8989f937aa931113845dcd65b5d1a7e5fd8bee4 (diff) |
Use correct size in fullscreen mode
Android does not report the full screen size in display metrics.
However, it does report the correct size for layouts, which we use
to get the available geometry. Since by definition, the available
geometry should always be inside the screen geometry, it is safe to
use the maximum of the two sizes.
Task-number: QTBUG-39977
Change-Id: I78d974f12274ca67eada43f5e1d80e70149efe3f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/plugins/platforms/android/androidjnimain.cpp')
-rw-r--r-- | src/plugins/platforms/android/androidjnimain.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp index e7e0375adf..6031739efb 100644 --- a/src/plugins/platforms/android/androidjnimain.cpp +++ b/src/plugins/platforms/android/androidjnimain.cpp @@ -554,6 +554,12 @@ static void setDisplayMetrics(JNIEnv */*env*/, jclass /*clazz*/, jint desktopWidthPixels, jint desktopHeightPixels, jdouble xdpi, jdouble ydpi, jdouble scaledDensity) { + // 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; |