summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
index 75a33cbda3..13b4203f7f 100644
--- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
@@ -295,6 +295,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
// close down during the cleanup.
qApp->processEvents(QEventLoop::ExcludeUserInputEvents | QEventLoop::ExcludeSocketNotifiers);
[NSApp runModalForWindow:mColorPanel];
+ mDialogIsExecuting = false;
return (mResultCode == NSOKButton);
}
@@ -384,7 +385,13 @@ void QCocoaColorDialogHelper::hide()
{
if (!mDelegate)
return;
- [reinterpret_cast<QNSColorPanelDelegate *>(mDelegate)->mColorPanel close];
+ QNSColorPanelDelegate *delegate = static_cast<QNSColorPanelDelegate *>(mDelegate);
+ if (![delegate->mColorPanel isVisible])
+ return;
+ if (delegate->mDialogIsExecuting)
+ [delegate->mColorPanel performClose:delegate];
+ else
+ [delegate->mColorPanel close];
}
void QCocoaColorDialogHelper::setCurrentColor(const QColor &color)