diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> | 2014-06-05 12:22:02 +0200 |
---|---|---|
committer | Christian Stromme <christian.stromme@digia.com> | 2014-06-13 21:54:02 +0200 |
commit | fb3f47b638fcdeb68c68fbda4943f4fbb22261c6 (patch) | |
tree | f4f66c7ce94a1f3578a2bb42e3912424b2b888e3 /src/plugins/platforms/android/qandroidplatformintegration.h | |
parent | 9c80a3be4b3beb28a3a6bda717c15b0ded523557 (diff) |
Android: Report something sensible for screen geometry
We can't get the actual screen geometry on Android, but in Qt 5.3.0
we would always return the screen geometry minus the size of the
status bar. After the available geometry was initialized to 0x0
instead of this arbitrary value, some applications that depended
on this as a constant value would break if they collected the
information before the window surface had been initialized and they
forgot to listen to QScreen::geometryChanged().
To reduce the risk of regressions, this patch makes sure we return
the same thing as before for the screen geometry and that this is
not linked directly to the available screen geometry.
Task-number: QTBUG-39464
Change-Id: Ie63337b3b10d2eb5130e4fece6c5b144e8230164
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
Diffstat (limited to 'src/plugins/platforms/android/qandroidplatformintegration.h')
-rw-r--r-- | src/plugins/platforms/android/qandroidplatformintegration.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformintegration.h b/src/plugins/platforms/android/qandroidplatformintegration.h index f8fa1a91dd..ce31516ace 100644 --- a/src/plugins/platforms/android/qandroidplatformintegration.h +++ b/src/plugins/platforms/android/qandroidplatformintegration.h @@ -86,6 +86,7 @@ public: virtual void setDesktopSize(int width, int height); virtual void setDisplayMetrics(int width, int height); + void setScreenSize(int width, int height); bool isVirtualDesktop() { return true; } QPlatformFontDatabase *fontDatabase() const; @@ -108,7 +109,7 @@ public: QStringList themeNames() const; QPlatformTheme *createPlatformTheme(const QString &name) const; - static void setDefaultDisplayMetrics(int gw, int gh, int sw, int sh); + static void setDefaultDisplayMetrics(int gw, int gh, int sw, int sh, int width, int height); static void setDefaultDesktopSize(int gw, int gh); static void setScreenOrientation(Qt::ScreenOrientation currentOrientation, Qt::ScreenOrientation nativeOrientation); @@ -135,6 +136,8 @@ private: static int m_defaultGeometryHeight; static int m_defaultPhysicalSizeWidth; static int m_defaultPhysicalSizeHeight; + static int m_defaultScreenWidth; + static int m_defaultScreenHeight; static Qt::ScreenOrientation m_orientation; static Qt::ScreenOrientation m_nativeOrientation; |