summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/dialogs/qprintdialog_mac.mm6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/dialogs/qprintdialog_mac.mm b/src/gui/dialogs/qprintdialog_mac.mm
index 71395d0316..64cc243ea2 100644
--- a/src/gui/dialogs/qprintdialog_mac.mm
+++ b/src/gui/dialogs/qprintdialog_mac.mm
@@ -305,6 +305,12 @@ void QPrintDialogPrivate::openCocoaPrintPanel(Qt::WindowModality modality)
macStartInterceptWindowTitle(q);
printPanel = [NSPrintPanel printPanel];
QT_MANGLE_NAMESPACE(QCocoaPrintPanelDelegate) *delegate = [[QT_MANGLE_NAMESPACE(QCocoaPrintPanelDelegate) alloc] init];
+
+ // Call processEvents in case the event dispatcher has been interrupted, and needs to do
+ // cleanup of modal sessions. Do this before showing the native dialog, otherwise it will
+ // close down during the cleanup (QTBUG-17913):
+ qApp->processEvents(QEventLoop::ExcludeUserInputEvents, QEventLoop::ExcludeSocketNotifiers);
+
[printPanel setOptions:macOptions];
if (modality == Qt::ApplicationModal) {