summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Manuel Duclos Vergara <carlos.duclos@nokia.com>2010-04-06 11:47:24 (GMT)
committerCarlos Manuel Duclos Vergara <carlos.duclos@nokia.com>2010-04-06 11:49:30 (GMT)
commit0c442405a9f85f402d508af2be0a668f34f35caf (patch)
tree7a80594ebc521688f245fef690dd44aec9b80a3b
parentb9e86b13679f9714b1b72fbaaa94badbdd1b3ff9 (diff)
downloadQt-0c442405a9f85f402d508af2be0a668f34f35caf.zip
Qt-0c442405a9f85f402d508af2be0a668f34f35caf.tar.gz
Qt-0c442405a9f85f402d508af2be0a668f34f35caf.tar.bz2
[Cocoa] QDialogs with WindowStayOnStopHint parent
The problem is with beginModalSession which reorders the windows and sends our window back. This patch queries the window level before calling beginModalSession and sets it after beginModalSession. Task-number: QTBUG-9392 Reviewed-by: Richard Moe Gustavsen
-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;
}