summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-10-18 13:27:02 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-12-13 12:50:09 (GMT)
commita04b19d34c23df5bb6e4f499b6b12c7a1211969a (patch)
tree7e4d725c1907b38a64f573d4adabc0a031a741dd /src/gui/kernel
parent7ee2e9fd873b2c38a1a362170c4a0e4754cfd22a (diff)
downloadQt-a04b19d34c23df5bb6e4f499b6b12c7a1211969a.zip
Qt-a04b19d34c23df5bb6e4f499b6b12c7a1211969a.tar.gz
Qt-a04b19d34c23df5bb6e4f499b6b12c7a1211969a.tar.bz2
Cocoa: make sure stays on top child windows are not levelled down
[NSWindow addChild] levels the child to the level of the parent. In Qt we do not want this. So we do a check after setting up the parent-child relationship for this. Reviewed-by: cduclos
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qwidget_mac.mm12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 997419b..08af3ac 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -2822,8 +2822,12 @@ 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]) {
+ NSInteger level = [qwin level];
[pwin addChildWindow:qwin ordered:NSWindowAbove];
+ if ([qwin level] < level)
+ [qwin setLevel:level];
+ }
} else {
[pwin removeChildWindow:qwin];
}
@@ -2837,8 +2841,12 @@ void QWidgetPrivate::setSubWindowStacking(bool set)
if (NSWindow *cwin = [qt_mac_nativeview_for(child) window]) {
if (set) {
Qt::WindowType ctype = child->window()->windowType();
- if ([cwin isVisible] && (ctype == Qt::Window || ctype == Qt::Dialog) && ![cwin parentWindow])
+ if ([cwin isVisible] && (ctype == Qt::Window || ctype == Qt::Dialog) && ![cwin parentWindow]) {
+ NSInteger level = [cwin level];
[qwin addChildWindow:cwin ordered:NSWindowAbove];
+ if ([cwin level] < level)
+ [cwin setLevel:level];
+ }
} else {
[qwin removeChildWindow:qt_mac_window_for(child)];
}