summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCarlos Manuel Duclos Vergara <carlos.duclos@nokia.com>2010-05-04 14:03:27 (GMT)
committerCarlos Manuel Duclos Vergara <carlos.duclos@nokia.com>2010-05-06 08:25:12 (GMT)
commitae786d63683db1aea1a4ad7eea2c4e20d5c1752d (patch)
tree429d0efffd41e46bde34d7181a18a3e643bd2032 /src
parentefb26a325dcea5e60d7801fef00e650bd028c16d (diff)
downloadQt-ae786d63683db1aea1a4ad7eea2c4e20d5c1752d.zip
Qt-ae786d63683db1aea1a4ad7eea2c4e20d5c1752d.tar.gz
Qt-ae786d63683db1aea1a4ad7eea2c4e20d5c1752d.tar.bz2
isOnActiveSpace is available from 10.6.
The fix for qtcreatorbug-827 included a call to isOnActiveSpace, which is only available from 10.6 so this patch adds a runtime check for it. Since it is a runtime check there is no need for multiple builds. Notice that the fix for qtcreatorbug-827 will work only on 10.6+ Task-number: QTCREATORBUG-827 Reviewed-by: Richard Moe Gustavsen
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qwidget_mac.mm21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 81dd746..f12c956 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -3835,13 +3835,20 @@ void QWidgetPrivate::raise_sys()
// required we will introduce special handling for some of them.
if (!q->testAttribute(Qt::WA_DontShowOnScreen) && q->isVisible()) {
OSWindowRef window = qt_mac_window_for(q);
- if(![window isOnActiveSpace]) {
- QWidget *parentWidget = q->parentWidget();
- if(parentWidget) {
- OSWindowRef parentWindow = qt_mac_window_for(parentWidget);
- if(parentWindow && [parentWindow isOnActiveSpace]) {
- recreateMacWindow();
- window = qt_mac_window_for(q);
+ // isOnActiveSpace is available only from 10.6 onwards, so we need to check if it is
+ // available before calling it.
+ if([window respondsToSelector:@selector(isOnActiveSpace)]) {
+ if(![window performSelector:@selector(isOnActiveSpace)]) {
+ QWidget *parentWidget = q->parentWidget();
+ if(parentWidget) {
+ OSWindowRef parentWindow = qt_mac_window_for(parentWidget);
+ if(parentWindow && [parentWindow isOnActiveSpace]) {
+ // The window was created in a different space. Therefore if we want
+ // to show it in the current space we need to recreate it in the new
+ // space.
+ recreateMacWindow();
+ window = qt_mac_window_for(q);
+ }
}
}
}