diff options
author | David Boddie <dboddie@trolltech.com> | 2010-08-13 13:52:57 (GMT) |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2010-08-13 13:52:57 (GMT) |
commit | 2a2aa1b0581911de907f7b950b5cf4acda914170 (patch) | |
tree | 09139b60b33bfed5932337ae05221b7c1c510e64 /src | |
parent | 9878c1765332d9a68a8371b90888fe09e272c7a8 (diff) | |
parent | 8b7d63d3c537c481ed3ad134a7ed75af8ed1e6b4 (diff) | |
download | Qt-2a2aa1b0581911de907f7b950b5cf4acda914170.zip Qt-2a2aa1b0581911de907f7b950b5cf4acda914170.tar.gz Qt-2a2aa1b0581911de907f7b950b5cf4acda914170.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qeventdispatcher_mac.mm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/kernel/qeventdispatcher_mac.mm b/src/gui/kernel/qeventdispatcher_mac.mm index e26fbde..89f01d8 100644 --- a/src/gui/kernel/qeventdispatcher_mac.mm +++ b/src/gui/kernel/qeventdispatcher_mac.mm @@ -785,7 +785,7 @@ void QEventDispatcherMacPrivate::temporarilyStopAllModalSessions() // the stacking order of the windows while doing so, we put // up a block that is used in QCocoaWindow and QCocoaPanel: int stackSize = cocoaModalSessionStack.size(); - for (int i=stackSize-1; i>=0; --i) { + for (int i=0; i<stackSize; ++i) { QCocoaModalSessionInfo &info = cocoaModalSessionStack[i]; if (info.session) { [NSApp endModalSession:info.session]; @@ -822,12 +822,12 @@ NSModalSession QEventDispatcherMacPrivate::currentModalSession() QBoolBlocker block1(blockSendPostedEvents, true); info.nswindow = window; [(NSWindow*) info.nswindow retain]; - // When creating a modal session cocoa will rearrange the windows. - // In order to avoid windows to be put behind another we need to - // keep the window level. - int level = [window level]; + int levelBeforeEnterModal = [window level]; info.session = [NSApp beginModalSessionForWindow:window]; - [window setLevel:level]; + // Make sure we don't stack the window lower that it was before + // entering modal, in case it e.g. had the stays-on-top flag set: + if (levelBeforeEnterModal > [window level]) + [window setLevel:levelBeforeEnterModal]; } currentModalSessionCached = info.session; } |