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/qandroidplatformscreen.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/qandroidplatformscreen.h')
-rw-r--r-- | src/plugins/platforms/android/qandroidplatformscreen.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformscreen.h b/src/plugins/platforms/android/qandroidplatformscreen.h index 96a91fbf06..cd9cf2ca71 100644 --- a/src/plugins/platforms/android/qandroidplatformscreen.h +++ b/src/plugins/platforms/android/qandroidplatformscreen.h @@ -66,7 +66,8 @@ public: QAndroidPlatformScreen(); ~QAndroidPlatformScreen(); - QRect geometry() const { return m_geometry; } + QRect geometry() const { return QRect(QPoint(), m_size); } + QRect availableGeometry() const { return m_availableGeometry; } int depth() const { return m_depth; } QImage::Format format() const { return m_format; } QSizeF physicalSize() const { return m_physicalSize; } @@ -87,7 +88,8 @@ public: public slots: void setDirty(const QRect &rect); void setPhysicalSize(const QSize &size); - void setGeometry(const QRect &rect); + void setAvailableGeometry(const QRect &rect); + void setSize(const QSize &size); protected: typedef QList<QAndroidPlatformWindow *> WindowStackType; @@ -95,7 +97,7 @@ protected: QRect m_dirtyRect; QTimer m_redrawTimer; - QRect m_geometry; + QRect m_availableGeometry; int m_depth; QImage::Format m_format; QSizeF m_physicalSize; @@ -114,6 +116,7 @@ private: QAtomicInt m_rasterSurfaces = 0; ANativeWindow* m_nativeSurface = nullptr; QWaitCondition m_surfaceWaitCondition; + QSize m_size; }; QT_END_NAMESPACE |