Android: Properly update geometry once the platform plugin is ready
This is amends commit 9091a058bc to make sure we don't drop
geometry updates that are set before the platform plugins is ready.
Task-number: QTBUG-60963
Change-Id: I4489eb9329bb8983458ad328a43b85382bba3cf6
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
bb10
parent
147aa29162
commit
b684ed6bd7
|
|
@ -142,6 +142,7 @@ namespace QtAndroid
|
|||
// flush the pending state if necessary.
|
||||
if (m_androidPlatformIntegration) {
|
||||
flushPendingApplicationState();
|
||||
m_androidPlatformIntegration->flushPendingUpdates();
|
||||
} else {
|
||||
QMutexLocker locker(&m_pendingAppStateMtx);
|
||||
m_pendingApplicationState = -1;
|
||||
|
|
@ -627,6 +628,7 @@ static void setDisplayMetrics(JNIEnv */*env*/, jclass /*clazz*/,
|
|||
m_scaledDensity = scaledDensity;
|
||||
m_density = density;
|
||||
|
||||
QMutexLocker lock(&m_surfacesMutex);
|
||||
if (!m_androidPlatformIntegration) {
|
||||
QAndroidPlatformIntegration::setDefaultDisplayMetrics(desktopWidthPixels,
|
||||
desktopHeightPixels,
|
||||
|
|
|
|||
|
|
@ -405,6 +405,14 @@ void QAndroidPlatformIntegration::setScreenOrientation(Qt::ScreenOrientation cur
|
|||
m_nativeOrientation = nativeOrientation;
|
||||
}
|
||||
|
||||
void QAndroidPlatformIntegration::flushPendingUpdates()
|
||||
{
|
||||
m_primaryScreen->setPhysicalSize(QSize(m_defaultPhysicalSizeWidth,
|
||||
m_defaultPhysicalSizeHeight));
|
||||
m_primaryScreen->setSize(QSize(m_defaultScreenWidth, m_defaultScreenHeight));
|
||||
m_primaryScreen->setAvailableGeometry(QRect(0, 0, m_defaultGeometryWidth, m_defaultGeometryHeight));
|
||||
}
|
||||
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
QPlatformAccessibility *QAndroidPlatformIntegration::accessibility() const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -126,6 +126,8 @@ public:
|
|||
QTouchDevice *touchDevice() const { return m_touchDevice; }
|
||||
void setTouchDevice(QTouchDevice *touchDevice) { m_touchDevice = touchDevice; }
|
||||
|
||||
void flushPendingUpdates();
|
||||
|
||||
private:
|
||||
EGLDisplay m_eglDisplay;
|
||||
QTouchDevice *m_touchDevice;
|
||||
|
|
|
|||
Loading…
Reference in New Issue