From ac2b15bdd0fa960644b956fbc9a8bf9fe5ff68f5 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 1 Jul 2014 09:11:00 +0200 Subject: Android: [REG] Fix QScreen::physicalSize() The physical size should be set based on the screen size, not the available geometry. This used to work in Qt 5.3.0 because the screenSize and size of the available geometry was identical on startup, but in Qt 5.3.1 the available geometry is 0x0 until there the metrics are actually available to avoid flickering on startup, so this caused a regression. [ChangeLog][Android] Fixed regression where QScreen::physicalSize() would return 0x0. Change-Id: I6c2ee11205427a88764e129b05ece6d3fbbf4c99 Task-number: QTBUG-39978 Reviewed-by: Christian Stromme Reviewed-by: BogDan Vatra --- src/plugins/platforms/android/androidjnimain.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp index 09c56f398c..d82487ae9b 100644 --- a/src/plugins/platforms/android/androidjnimain.cpp +++ b/src/plugins/platforms/android/androidjnimain.cpp @@ -562,13 +562,13 @@ static void setDisplayMetrics(JNIEnv */*env*/, jclass /*clazz*/, if (!m_androidPlatformIntegration) { QAndroidPlatformIntegration::setDefaultDisplayMetrics(desktopWidthPixels, desktopHeightPixels, - qRound(double(desktopWidthPixels) / xdpi * 25.4), - qRound(double(desktopHeightPixels) / ydpi * 25.4), + qRound(double(widthPixels) / xdpi * 25.4), + qRound(double(heightPixels) / ydpi * 25.4), widthPixels, heightPixels); } else { - m_androidPlatformIntegration->setDisplayMetrics(qRound(double(desktopWidthPixels) / xdpi * 25.4), - qRound(double(desktopHeightPixels) / ydpi * 25.4)); + m_androidPlatformIntegration->setDisplayMetrics(qRound(double(widthPixels) / xdpi * 25.4), + qRound(double(heightPixels) / ydpi * 25.4)); m_androidPlatformIntegration->setDesktopSize(desktopWidthPixels, desktopHeightPixels); m_androidPlatformIntegration->setScreenSize(widthPixels, heightPixels); } -- cgit v1.2.3