diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2020-06-24 15:13:06 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-06-27 21:18:05 +0000 |
commit | 040a7cfa93f12e8091954e463cdce3b515917c40 (patch) | |
tree | 6104eb17b7f7a78b3f3b6679abeb16da30838541 | |
parent | 33714b6c022183ca4bd98b7158d072b3892d4d32 (diff) |
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 <richard.gustavsen@qt.io>
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm | 5 |
1 files changed, 5 insertions, 0 deletions
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) { |