summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_mac.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qwidget_mac.mm')
-rw-r--r--src/gui/kernel/qwidget_mac.mm14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 48a4bc334..5948cd4c7 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -3197,10 +3197,13 @@ void QWidgetPrivate::show_sys()
#else
// sync the opacity value back (in case of a fade).
[window setAlphaValue:q->windowOpacity()];
-
[window makeKeyAndOrderFront:window];
+
+ // If this window is app modal, we need to start spinning
+ // a modal session for it. Interrupting
+ // the event dispatcher will make this happend:
if (data.window_modality == Qt::ApplicationModal)
- QCoreApplication::postEvent(qApp, new QEvent(QEvent::CocoaRequestModal));
+ QEventDispatcherMac::instance()->interrupt();
#endif
if (q->windowType() == Qt::Popup) {
if (q->focusWidget())
@@ -3218,13 +3221,6 @@ void QWidgetPrivate::show_sys()
#endif
} else if (!q->testAttribute(Qt::WA_ShowWithoutActivating)) {
qt_event_request_activate(q);
-#ifdef QT_MAC_USE_COCOA
- if (q->windowModality() == Qt::ApplicationModal) {
- // We call 'activeModalSession' early to force creation of q's modal
- // session. This seems neccessary for child dialogs to pop to front:
- QEventDispatcherMacPrivate::activeModalSession();
- }
-#endif
}
} else if(topData()->embedded || !q->parentWidget() || q->parentWidget()->isVisible()) {
#ifndef QT_MAC_USE_COCOA