From 040a7cfa93f12e8091954e463cdce3b515917c40 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 24 Jun 2020 15:13:06 +0200 Subject: macOS: Clean up modal sessions after each pass of processEvents() The Qt macOS event dispatcher defers modal session cleanup until the next runloop pass. But as it stood, we never did do so for stand-alone qApp->processEvents() calls. The result was that a NSModalSession would be kept alive longer than necessary, which would impact the activation state of other QWindows. Change-Id: I054f3084132c9d20a29a3f5823c19b7123ef40bf Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm') diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm index 597b380caf..0480ec0482 100644 --- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm +++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm @@ -504,6 +504,11 @@ bool QCocoaEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags) retVal = true; } } + + // Clean up the modal session list, call endModalSession. + if (d->cleanupModalSessionsNeeded) + d->cleanupModalSessions(); + } while (!d->interrupt && event); if ((d->processEventsFlags & QEventLoop::EventLoopExec) == 0) { -- cgit v1.2.3