From 3e4f885f0c8f9d4e951241459d310ed977936806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 16 Jun 2016 15:39:33 +0200 Subject: UIKit: Ensure that Qt's application state is initialized at startup Using dispatch_async to deliver the initial application state at startup was broken, as that would leave the application in the default application state, inactive, until the next runloop pass. This became a problem when an application was started backgrounded, eg. in response to location updates or a Bluetooth accessory waking it up, as it would have a small window of time at startup where it would think it was able to render content (since the window was exposed), while in fact the application was running in the background. iOS will in these situations kill the app for doing background rendering. Change-Id: I1ab4a6af08a154d8625c6451b4b5c8f4453e6b43 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qiosapplicationstate.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/ios/qiosapplicationstate.h') diff --git a/src/plugins/platforms/ios/qiosapplicationstate.h b/src/plugins/platforms/ios/qiosapplicationstate.h index 0564533043..710621c65b 100644 --- a/src/plugins/platforms/ios/qiosapplicationstate.h +++ b/src/plugins/platforms/ios/qiosapplicationstate.h @@ -35,10 +35,11 @@ #define QIOSAPPLICATIONSTATE_H #include +#include -QT_BEGIN_NAMESPACE +Q_FORWARD_DECLARE_OBJC_CLASS(NSObject); -@class QIOSApplicationStateListener; +QT_BEGIN_NAMESPACE class QIOSApplicationState { @@ -46,7 +47,7 @@ public: QIOSApplicationState(); ~QIOSApplicationState(); private: - QIOSApplicationStateListener *m_listener; + QVector m_observers; }; QT_END_NAMESPACE -- cgit v1.2.3