From 428dbe8f0ed28e5ef37395127d55503b37acbced Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Thu, 20 Oct 2011 14:31:41 -0400 Subject: [PATCH] Runtime check for lion instead of compile-time --- src/mac/tomahawkapp_mac.mm | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/mac/tomahawkapp_mac.mm b/src/mac/tomahawkapp_mac.mm index 91237e67a..dc4210f84 100644 --- a/src/mac/tomahawkapp_mac.mm +++ b/src/mac/tomahawkapp_mac.mm @@ -234,19 +234,23 @@ void Tomahawk::checkForUpdates() { void Tomahawk::enableFullscreen() { -#ifdef LION - qDebug() << "Enabling Lion Full-screeen"; - // Can't include tomahawkapp.h in a .mm file, pulls in infosystem.h which uses - // the objc keyword 'id' - foreach( QWidget* w, QApplication::topLevelWidgets() ) + // We don't support anything below leopard, so if it's not [snow] leopard it must be lion + // Can't check for lion as Qt 4.7 doesn't have the enum val, not checking for Unknown as it will be lion + // on 4.8 + if ( QSysInfo::MacintoshVersion != QSysInfo::MV_SNOWLEOPARD && + QSysInfo::MacintoshVersion != QSysInfo::MV_LEOPARD ) { - if ( qobject_cast< TomahawkWindow* >( w ) ) + qDebug() << "Enabling Lion Full-screeen"; + // Can't include tomahawkapp.h in a .mm file, pulls in infosystem.h which uses + // the objc keyword 'id' + foreach( QWidget* w, QApplication::topLevelWidgets() ) { - NSView *nsview = (NSView *)w->winId(); - NSWindow *nswindow = [nsview window]; - [nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; + if ( qobject_cast< TomahawkWindow* >( w ) ) + { + NSView *nsview = (NSView *)w->winId(); + NSWindow *nswindow = [nsview window]; + [nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; + } } } - -#endif }