diff options
author | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2015-03-09 17:39:35 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2015-03-10 12:48:32 +0000 |
commit | de92efd44812640aefa4f02fb8d9f8f6d04de688 (patch) | |
tree | fb2d3b7a563e998eded5ffad63cf68180046c50e /src/platformsupport | |
parent | dfd6fc7bce67eaddf4333c65d8d160a6ca4a8e82 (diff) | |
download | qtbase-de92efd44812640aefa4f02fb8d9f8f6d04de688.tar.gz |
CF event dispatcher: Decide if eventsProcessed before breaking out of loop
In the case of calling processEvents with WaitForMoreEvents and ending up
processing a Qt timer, we explicitly interrupt the runloop, as CF doesn't
normally treat handling timers as having handled a source. That way we
can re-evaluate whether processEvents should return.
But, we need to compute eventsProcessed before breaking out of the
Q_FOREVER loop, otherwise processEvents will return false when
waiting for events and processing a timer.
Change-Id: Ie5f8905228cce1508b5b2e040cf1186820855191
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Diffstat (limited to 'src/platformsupport')
-rw-r--r-- | src/platformsupport/eventdispatchers/qeventdispatcher_cf.mm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/platformsupport/eventdispatchers/qeventdispatcher_cf.mm b/src/platformsupport/eventdispatchers/qeventdispatcher_cf.mm index bd0f89ba2f..13b7dc4358 100644 --- a/src/platformsupport/eventdispatchers/qeventdispatcher_cf.mm +++ b/src/platformsupport/eventdispatchers/qeventdispatcher_cf.mm @@ -268,6 +268,10 @@ bool QEventDispatcherCoreFoundation::processEvents(QEventLoop::ProcessEventsFlag qUnIndent(); qEventDispatcherDebug() << "result = " << qPrintableResult(result); + eventsProcessed |= (result == kCFRunLoopRunHandledSource + || m_processEvents.processedPostedEvents + || m_processEvents.processedTimers); + if (result == kCFRunLoopRunFinished) { // This should only happen at application shutdown, as the main runloop // will presumably always have sources registered. @@ -302,10 +306,6 @@ bool QEventDispatcherCoreFoundation::processEvents(QEventLoop::ProcessEventsFlag } } - eventsProcessed |= (result == kCFRunLoopRunHandledSource - || m_processEvents.processedPostedEvents - || m_processEvents.processedTimers); - if (m_processEvents.flags & QEventLoop::EventLoopExec) { // We were called from QEventLoop's exec(), which blocks until the event // loop is asked to exit by calling processEvents repeatedly. Instead of |