summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qeventdispatcher_mac.mm9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/kernel/qeventdispatcher_mac.mm b/src/gui/kernel/qeventdispatcher_mac.mm
index 62e1e81..a7f1224 100644
--- a/src/gui/kernel/qeventdispatcher_mac.mm
+++ b/src/gui/kernel/qeventdispatcher_mac.mm
@@ -831,7 +831,14 @@ NSModalSession QEventDispatcherMacPrivate::currentModalSession()
QBoolBlocker block1(blockSendPostedEvents, true);
info.nswindow = window;
[(NSWindow*) info.nswindow retain];
- info.session = [NSApp beginModalSessionForWindow:window];
+ // 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];
+ info.session = [NSApp beginModalSessionForWindow:window];
+ [window setLevel:level];
+ }
}
currentModalSessionCached = info.session;
}