mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
Attempt to make sizegrip fix work from 10.6 builds
This commit is contained in:
@@ -253,8 +253,10 @@ void Tomahawk::checkForUpdates() {
|
||||
|
||||
#ifdef LION
|
||||
#define SET_LION_FULLSCREEN NSWindowCollectionBehaviorFullScreenPrimary
|
||||
#define LION_FULLSCREEN_NOTIFICATION_VALUE NSWindowWillEnterFullScreenNotification
|
||||
#else
|
||||
#define SET_LION_FULLSCREEN (NSUInteger)(1 << 7) // Defined as NSWindowCollectionBehaviorFullScreenPrimary in lion's NSWindow.h
|
||||
#define LION_FULLSCREEN_NOTIFICATION_VALUE @"NSWindowWillEnterFullScreenNotification"
|
||||
#endif
|
||||
|
||||
void Tomahawk::enableFullscreen( QObject* receiver )
|
||||
@@ -276,25 +278,23 @@ void Tomahawk::enableFullscreen( QObject* receiver )
|
||||
NSWindow *nswindow = [nsview window];
|
||||
[nswindow setCollectionBehavior:SET_LION_FULLSCREEN];
|
||||
|
||||
#ifdef LION
|
||||
if ( !receiver )
|
||||
continue;
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:NSWindowWillEnterFullScreenNotification
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:LION_FULLSCREEN_NOTIFICATION_VALUE
|
||||
object:nswindow
|
||||
queue:nil
|
||||
usingBlock:^(NSNotification * note) {
|
||||
NSLog(@"Became Full Screen!");
|
||||
QMetaObject::invokeMethod( receiver, "fullScreenEntered", Qt::DirectConnection );
|
||||
}];
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:NSWindowDidExitFullScreenNotification
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:LION_FULLSCREEN_NOTIFICATION_VALUE
|
||||
object:nswindow
|
||||
queue:nil
|
||||
usingBlock:^(NSNotification * note) {
|
||||
NSLog(@"Left Full Screen!");
|
||||
QMetaObject::invokeMethod( receiver, "fullScreenExited", Qt::DirectConnection );
|
||||
}];
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user