From 90ed77c0448b2104d3235f9d064ad57d95f1a976 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Tue, 19 Aug 2014 15:55:32 +0200 Subject: 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 --- src/plugins/platforms/android/androidjnimain.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- cgit v1.2.3