summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm4
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm5
-rw-r--r--src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm4
3 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
index 389ba357d5..1deb92cb04 100644
--- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
@@ -282,6 +282,10 @@ static NSButton *macCreateButton(const char *text, NSView *superview)
mDialogIsExecuting = true;
[mColorPanel setDelegate:self];
[mColorPanel setContinuous:YES];
+ // 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.
+ qApp->processEvents(QEventLoop::ExcludeUserInputEvents | QEventLoop::ExcludeSocketNotifiers);
[NSApp runModalForWindow:mColorPanel];
return (mResultCode == NSOKButton);
}
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
index 682ef48cda..f9122f56d1 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
@@ -248,6 +248,11 @@ static QString strippedText(QString s)
[mSavePanel setDirectoryURL:selectable ? [NSURL fileURLWithPath:QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.filePath())]
: [NSURL fileURLWithPath:QT_PREPEND_NAMESPACE(QCFString::toNSString)(info.path())]];
+
+ // 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.
+ qApp->processEvents(QEventLoop::ExcludeUserInputEvents | QEventLoop::ExcludeSocketNotifiers);
mReturnCode = [mSavePanel runModal];
QAbstractEventDispatcher::instance()->interrupt();
diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
index ad93310f54..5ccd019a9b 100644
--- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
@@ -301,6 +301,10 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
{
mDialogIsExecuting = true;
[mFontPanel setDelegate:self];
+ // 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.
+ qApp->processEvents(QEventLoop::ExcludeUserInputEvents | QEventLoop::ExcludeSocketNotifiers);
[NSApp runModalForWindow:mFontPanel];
return (mResultCode == NSOKButton);
}