summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qwidget_mac.mm15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 0f4abfa..aca1d53 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -2795,11 +2795,9 @@ void QWidgetPrivate::transferChildren()
void QWidgetPrivate::setSubWindowStacking(bool set)
{
// After hitting too many unforeseen bugs trying to put Qt on top of the cocoa child
- // window API, we have decided to revert this behaviour. For compability
- // reasons we leave the code here for applications depending on it:
+ // window API, we have decided to revert this behaviour as much as we can. We
+ // therefore now only allow child windows to exist for children of modal dialogs.
static bool use_behaviour_qt473 = !qgetenv("QT_MAC_USE_CHILDWINDOWS").isEmpty();
- if (use_behaviour_qt473 == false)
- return;
// This will set/remove a visual relationship between parent and child on screen.
// The reason for doing this is to ensure that a child always stacks infront of
@@ -2829,7 +2827,10 @@ void QWidgetPrivate::setSubWindowStacking(bool set)
if (NSWindow *pwin = [qt_mac_nativeview_for(parent) window]) {
if (set) {
Qt::WindowType ptype = parent->window()->windowType();
- if ([pwin isVisible] && (ptype == Qt::Window || ptype == Qt::Dialog) && ![qwin parentWindow]) {
+ if ([pwin isVisible]
+ && (ptype == Qt::Window || ptype == Qt::Dialog)
+ && ![qwin parentWindow]
+ && (!use_behaviour_qt473 && parent->windowModality() == Qt::ApplicationModal)) {
NSInteger level = [qwin level];
[pwin addChildWindow:qwin ordered:NSWindowAbove];
if ([qwin level] < level)
@@ -2841,6 +2842,10 @@ void QWidgetPrivate::setSubWindowStacking(bool set)
}
}
+ // Only set-up child windows for q if q is modal:
+ if (set && !use_behaviour_qt473 && q->windowModality() != Qt::ApplicationModal)
+ return;
+
QObjectList widgets = q->children();
for (int i=0; i<widgets.size(); ++i) {
QWidget *child = qobject_cast<QWidget *>(widgets.at(i));