summaryrefslogtreecommitdiffstats
path: root/src/printsupport
diff options
context:
space:
mode:
Diffstat (limited to 'src/printsupport')
-rw-r--r--src/printsupport/dialogs/qprintdialog_mac.mm5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/printsupport/dialogs/qprintdialog_mac.mm b/src/printsupport/dialogs/qprintdialog_mac.mm
index ddbe0d0f2e..dc940d5d6d 100644
--- a/src/printsupport/dialogs/qprintdialog_mac.mm
+++ b/src/printsupport/dialogs/qprintdialog_mac.mm
@@ -192,6 +192,11 @@ void QPrintDialogPrivate::openCocoaPrintPanel(Qt::WindowModality modality)
[printPanel retain];
[printPanel setOptions:macOptions];
+ // 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);
+
QT_MANGLE_NAMESPACE(QCocoaPrintPanelDelegate) *delegate = [[QT_MANGLE_NAMESPACE(QCocoaPrintPanelDelegate) alloc] init];
if (modality == Qt::ApplicationModal) {
int rval = [printPanel runModalWithPrintInfo:printInfo];