diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2010-08-03 08:35:35 (GMT) |
---|---|---|
committer | Toby Tomkins <toby.tomkins@nokia.com> | 2010-08-04 03:47:22 (GMT) |
commit | 3d7da23433e81db1f8c80a53fdae73b2f647ea3e (patch) | |
tree | 8a4cfef5bce95a2fd1f8e5a1bb9e54c9240b4644 /src/gui/kernel/qt_cocoa_helpers_mac.mm | |
parent | 1c850efd7f877b5091d36ddfe98d8c2cb787f606 (diff) | |
download | Qt-3d7da23433e81db1f8c80a53fdae73b2f647ea3e.zip Qt-3d7da23433e81db1f8c80a53fdae73b2f647ea3e.tar.gz Qt-3d7da23433e81db1f8c80a53fdae73b2f647ea3e.tar.bz2 |
Cocoa: Active QDockWidget does not stay on top of inactive QDockWidget
If a window has several child windows, it was not be possible to
click on a child window to make it stack in front of the other
children. The reason is that cocoa held a fixed stacking order of
the child windows (sub-windows). This patch will release, and then
reestablish, the stacking order of the children upon acitvation.
Task-number: QTBUG-11780
Reviewed-by: prasanth
(cherry picked from commit 44e11692549f1d6a4fed01066a06085dacfaa444)
Diffstat (limited to 'src/gui/kernel/qt_cocoa_helpers_mac.mm')
-rw-r--r-- | src/gui/kernel/qt_cocoa_helpers_mac.mm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index 3fc27f4..647cb86 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -1527,6 +1527,22 @@ void macSyncDrawingOnFirstInvocation(void * /*OSWindowRef */window) [theWindow display]; } } + +void qt_cocoaStackChildWindowOnTopOfOtherChildren(QWidget *childWidget) +{ + if (!childWidget) + return; + + QWidget *parent = childWidget->parentWidget(); + if (childWidget->isWindow() && parent) { + if ([[qt_mac_window_for(parent) childWindows] containsObject:qt_mac_window_for(childWidget)]) { + QWidgetPrivate *d = qt_widget_private(childWidget); + d->setSubWindowStacking(false); + d->setSubWindowStacking(true); + } + } +} + #endif // QT_MAC_USE_COCOA QT_END_NAMESPACE |