1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 11:20:22 +02:00

Runtime check for lion instead of compile-time

This commit is contained in:
Leo Franchi
2011-10-20 14:31:41 -04:00
parent f24a25b370
commit 428dbe8f0e

View File

@@ -234,19 +234,23 @@ void Tomahawk::checkForUpdates() {
void Tomahawk::enableFullscreen() void Tomahawk::enableFullscreen()
{ {
#ifdef LION // We don't support anything below leopard, so if it's not [snow] leopard it must be lion
qDebug() << "Enabling Lion Full-screeen"; // Can't check for lion as Qt 4.7 doesn't have the enum val, not checking for Unknown as it will be lion
// Can't include tomahawkapp.h in a .mm file, pulls in infosystem.h which uses // on 4.8
// the objc keyword 'id' if ( QSysInfo::MacintoshVersion != QSysInfo::MV_SNOWLEOPARD &&
foreach( QWidget* w, QApplication::topLevelWidgets() ) 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(); if ( qobject_cast< TomahawkWindow* >( w ) )
NSWindow *nswindow = [nsview window]; {
[nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; NSView *nsview = (NSView *)w->winId();
NSWindow *nswindow = [nsview window];
[nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
}
} }
} }
#endif
} }