summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@qt.io>2018-07-04 00:20:37 +0200
committerMorten Johan Sørvig <morten.sorvig@qt.io>2018-08-09 07:24:15 +0000
commita09c8b0ee6ddd13251ee1335ede73fd66e007a35 (patch)
tree9c7cb2af31892edc16b696c86bde948152b8cb2f /src/plugins/platforms
parent489ae6db3c1d4c78b60f67d1c64e6bdb820560eb (diff)
Make QEventDispatcherCoreFoundaton work on secondary threads
We were using CFRunLoopGetMain() everywhere. Get the correct run loop using CFRunLoopGetCurrent() during initialization, and store it. Event dispatcher initialization must now be delayed until after the constructor has run, since event dispatchers may be created on the main thread and then moved to the target thread. Initialize on first call to processEvents() where the current thread will be the correct thread. Use the stored m_runLoop instead of CFRunLoopGetMain(). This is required for wakeUp() and interrupt() which may be called from another thread. Change-Id: I6fffcfd4394899c4a12f241c42781979aaf99d5e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/ios/qioseventdispatcher.mm5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/platforms/ios/qioseventdispatcher.mm b/src/plugins/platforms/ios/qioseventdispatcher.mm
index 6a6e1bd618..776343c5aa 100644
--- a/src/plugins/platforms/ios/qioseventdispatcher.mm
+++ b/src/plugins/platforms/ios/qioseventdispatcher.mm
@@ -471,8 +471,9 @@ bool QIOSEventDispatcher::processPostedEvents()
return false;
QT_APPLE_SCOPED_LOG_ACTIVITY(lcEventDispatcher().isDebugEnabled(), "sendWindowSystemEvents");
- qCDebug(lcEventDispatcher) << "Sending window system events for" << m_processEvents.flags;
- QWindowSystemInterface::sendWindowSystemEvents(m_processEvents.flags);
+ QEventLoop::ProcessEventsFlags flags = QEventLoop::ProcessEventsFlags(m_processEvents.flags.load());
+ qCDebug(lcEventDispatcher) << "Sending window system events for" << flags;
+ QWindowSystemInterface::sendWindowSystemEvents(flags);
return true;
}