OSX: do not force a plain window to be on the same level as its parent
2af0a778f464980594c36098e4a8ba4448edfd29 the fix for QTBUG-27410 caused this Designer bug. Doing the automatic level escalation only for "special" windows and avoiding it for plain Qt::Window type windows is one way of fixing the Designer problem. Task-number: QTBUG-31779 Change-Id: I1da5454f31111f36480fac3b53be6d5f0ce40047 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This commit is contained in:
parent
b59c257a04
commit
c6e32b740c
@ -423,11 +423,13 @@ NSInteger QCocoaWindow::windowLevel(Qt::WindowFlags flags)
|
||||
if (type == Qt::ToolTip)
|
||||
windowLevel = NSScreenSaverWindowLevel;
|
||||
|
||||
// A window should be in at least the same level as its parent.
|
||||
const QWindow * const transientParent = window()->transientParent();
|
||||
const QCocoaWindow * const transientParentWindow = transientParent ? static_cast<QCocoaWindow *>(transientParent->handle()) : 0;
|
||||
if (transientParentWindow)
|
||||
windowLevel = qMax([transientParentWindow->m_nsWindow level], windowLevel);
|
||||
// Any "special" window should be in at least the same level as its parent.
|
||||
if (type != Qt::Window) {
|
||||
const QWindow * const transientParent = window()->transientParent();
|
||||
const QCocoaWindow * const transientParentWindow = transientParent ? static_cast<QCocoaWindow *>(transientParent->handle()) : 0;
|
||||
if (transientParentWindow)
|
||||
windowLevel = qMax([transientParentWindow->m_nsWindow level], windowLevel);
|
||||
}
|
||||
|
||||
return windowLevel;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user