diff options
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm index 2a41498564..b0f2b6d940 100644 --- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm +++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm @@ -120,11 +120,17 @@ void QCocoaEventDispatcherPrivate::runLoopTimerCallback(CFRunLoopTimerRef, void void QCocoaEventDispatcherPrivate::activateTimersSourceCallback(void *info) { QCocoaEventDispatcherPrivate *d = static_cast<QCocoaEventDispatcherPrivate *>(info); - (void) d->timerInfoList.activateTimers(); - d->maybeStartCFRunLoopTimer(); + d->processTimers(); d->maybeCancelWaitForMoreEvents(); } +bool QCocoaEventDispatcherPrivate::processTimers() +{ + int activated = timerInfoList.activateTimers(); + maybeStartCFRunLoopTimer(); + return activated > 0; +} + void QCocoaEventDispatcherPrivate::maybeStartCFRunLoopTimer() { if (timerInfoList.isEmpty()) { @@ -500,10 +506,9 @@ bool QCocoaEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags) } while (!d->interrupt && event); if ((d->processEventsFlags & QEventLoop::EventLoopExec) == 0) { - // when called "manually", always send posted events and timers + // When called "manually", always process posted events and timers d->processPostedEvents(); - retVal = d->timerInfoList.activateTimers() > 0 || retVal; - d->maybeStartCFRunLoopTimer(); + retVal = d->processTimers() || retVal; } // be sure to return true if the posted event source fired |