summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2012-12-18 21:10:58 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-14 21:00:41 (GMT)
commit05f5df11fb8041d44502a8ef8eb2674155fc6047 (patch)
tree3c9a16b070cd492495d224a16dc4bcd82f8ea310
parenta17fc85b51a6bdcfa33dcff183d2b7efd667fb92 (diff)
downloadQt-05f5df11fb8041d44502a8ef8eb2674155fc6047.zip
Qt-05f5df11fb8041d44502a8ef8eb2674155fc6047.tar.gz
Qt-05f5df11fb8041d44502a8ef8eb2674155fc6047.tar.bz2
Prevent a crash when hiding a window on Mac OS X 10.7 or later
If a tool window is ordered out when there is a full screen widget around then it would cause a crash because of a new animation from Lion. This seems to be provoked by the fact that we are faking the fullscreen functionality in Qt. Change-Id: I07cdfddc6c2bb766df7809912fb97c4f1ba8873b Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
-rw-r--r--src/gui/kernel/qwidget_mac.mm4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 76a7122..01150aa 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -3612,6 +3612,10 @@ void QWidgetPrivate::hide_sys()
#ifndef QT_MAC_USE_COCOA
ShowHide(window, false);
#else
+ // Only needed if it exists from 10.7 or later
+ if ((q->windowType() == Qt::Tool) && [window respondsToSelector: @selector(setAnimationBehavior:)])
+ [window setAnimationBehavior: 2]; // NSWindowAnimationBehaviorNone == 2
+
[window orderOut:window];
// Unfortunately it is not as easy as just hiding the window, we need
// to find out if we were in full screen mode. If we were and this is