summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qiosapplicationstate.mm
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-11-15 15:30:55 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-11-20 23:31:46 +0000
commit68733e307f209487e89b9261256ec0c0bc2352e2 (patch)
tree1c2d38702a93f3f058c65be4800d8fca8f6a679e /src/plugins/platforms/ios/qiosapplicationstate.mm
parent53f7c20cb5b5d5b25a70e072db82921ef2a449d1 (diff)
qpa: Teach handleApplicationStateChanged about sync/async delivery
Using QWindowSystemInterface::SynchronousDelivery reduces the chance that we are flushing other events before delivering the application state change. Those other events may conclude that the application is still active, while in reality it is not, and do bad things. Change-Id: I738c162fac22d2cd18de1e080bcd2cda78ec3f77 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/ios/qiosapplicationstate.mm')
-rw-r--r--src/plugins/platforms/ios/qiosapplicationstate.mm6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/ios/qiosapplicationstate.mm b/src/plugins/platforms/ios/qiosapplicationstate.mm
index 7b923e4692..13e7e1150f 100644
--- a/src/plugins/platforms/ios/qiosapplicationstate.mm
+++ b/src/plugins/platforms/ios/qiosapplicationstate.mm
@@ -39,6 +39,8 @@
#include "qiosapplicationstate.h"
+#include "qiosglobal.h"
+
#include <qpa/qwindowsysteminterface.h>
#include <QtCore/qcoreapplication.h>
@@ -72,8 +74,8 @@ static Qt::ApplicationState qtApplicationState(UIApplicationState uiApplicationS
static void handleApplicationStateChanged(UIApplicationState uiApplicationState)
{
Qt::ApplicationState state = qtApplicationState(uiApplicationState);
- QWindowSystemInterface::handleApplicationStateChanged(state);
- QWindowSystemInterface::flushWindowSystemEvents();
+ qCDebug(lcQpaApplication) << "moved to" << state;
+ QWindowSystemInterface::handleApplicationStateChanged<QWindowSystemInterface::SynchronousDelivery>(state);
}
QT_BEGIN_NAMESPACE