summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-10-18 07:28:14 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-12-13 12:50:09 (GMT)
commit7ee2e9fd873b2c38a1a362170c4a0e4754cfd22a (patch)
treea375e51c733a62e70d92f24c05e6e89842bf4cbb
parent694ef883b3ab40806bfe3356278c639942c8c69d (diff)
downloadQt-7ee2e9fd873b2c38a1a362170c4a0e4754cfd22a.zip
Qt-7ee2e9fd873b2c38a1a362170c4a0e4754cfd22a.tar.gz
Qt-7ee2e9fd873b2c38a1a362170c4a0e4754cfd22a.tar.bz2
Cocoa: native child filedialogs sometimes shows non-native on screen
The reason is that we make all child dialogs of a modal dialogs non-modaly shaddowed, as documented. But we forgot to check if a window is actually visible before raising it to front. Also adding harmless auto release pool Rev-By: prasanth
-rw-r--r--src/gui/kernel/qeventdispatcher_mac.mm3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/kernel/qeventdispatcher_mac.mm b/src/gui/kernel/qeventdispatcher_mac.mm
index 515c6d3..dc926e0 100644
--- a/src/gui/kernel/qeventdispatcher_mac.mm
+++ b/src/gui/kernel/qeventdispatcher_mac.mm
@@ -844,7 +844,7 @@ static void setChildrenWorksWhenModal(QWidget *widget, bool worksWhenModal)
NSWindow *window = qt_mac_window_for(dialogs[i]);
if (window && [window isKindOfClass:[NSPanel class]]) {
[static_cast<NSPanel *>(window) setWorksWhenModal:worksWhenModal];
- if (worksWhenModal && dialogs[i]->isVisible()){
+ if (worksWhenModal && [window isVisible]){
[window orderFront:window];
}
}
@@ -856,6 +856,7 @@ void QEventDispatcherMacPrivate::updateChildrenWorksWhenModal()
// Make the dialog children of the widget
// active. And make the dialog children of
// the previous modal dialog unactive again:
+ QMacCocoaAutoReleasePool pool;
int size = cocoaModalSessionStack.size();
if (size > 0){
if (QWidget *prevModal = cocoaModalSessionStack[size-1].widget)