summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
index 96a8fa1ad4..9aaf08adcf 100644
--- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
+++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
@@ -415,6 +415,11 @@ bool QCocoaEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
// 'session' as well. As a result, we need to restart all internal sessions:
d->temporarilyStopAllModalSessions();
}
+
+ // Clean up the modal session list, call endModalSession.
+ if (d->cleanupModalSessionsNeeded)
+ d->cleanupModalSessions();
+
} else {
d->nsAppRunCalledByQt = true;
QBoolBlocker execGuard(d->currentExecIsNSAppRun, true);
@@ -441,6 +446,11 @@ bool QCocoaEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
// 'session' as well. As a result, we need to restart all internal sessions:
d->temporarilyStopAllModalSessions();
}
+
+ // Clean up the modal session list, call endModalSession.
+ if (d->cleanupModalSessionsNeeded)
+ d->cleanupModalSessions();
+
retVal = true;
} else do {
// Dispatch all non-user events (but que non-user events up for later). In
@@ -860,9 +870,6 @@ void QCocoaEventDispatcherPrivate::processPostedEvents()
return;
}
- if (cleanupModalSessionsNeeded)
- cleanupModalSessions();
-
if (interrupt) {
if (currentExecIsNSAppRun) {
// The event dispatcher has been interrupted. But since