BOOL b_alreadyCounting;\r
int i_timeToKeepVisibleInSec;\r
\r
+ BOOL b_nonActive;\r
BOOL b_displayed;\r
BOOL b_voutWasUpdated;\r
int i_device;\r
- (void)setSeekable:(BOOL) b_seekable;\r
- (void)setVolumeLevel: (float)f_volumeLevel;\r
\r
+- (void)setNonActive:(id)noData;\r
+- (void)setActive:(id)noData;\r
+\r
- (void)focus:(NSTimer *)timer;\r
- (void)unfocus:(NSTimer *)timer;\r
- (void)mouseExited:(NSEvent *)theEvent;\r
[self mouseEntered:NULL];\r
if (!isInside)\r
[self mouseExited:NULL];\r
+ \r
+ /* get a notification if VLC isn't the active app anymore */\r
+ [[NSNotificationCenter defaultCenter]\r
+ addObserver: self\r
+ selector: @selector(setNonActive:)\r
+ name: NSApplicationDidResignActiveNotification\r
+ object: NSApp];\r
+ \r
+ /* get a notification if VLC is the active app again */\r
+ [[NSNotificationCenter defaultCenter]\r
+ addObserver: self\r
+ selector: @selector(setActive:)\r
+ name: NSApplicationDidBecomeActiveNotification\r
+ object: NSApp];\r
}\r
\r
/* Windows created with NSBorderlessWindowMask normally can't be key, but we want ours to be */\r
\r
-(void)dealloc\r
{\r
+ [[NSNotificationCenter defaultCenter] removeObserver: self];\r
+ \r
if( hideAgainTimer )\r
[hideAgainTimer release];\r
[self setFadeTimer:nil];\r
[[self contentView] setVolumeLevel: f_volumeLevel];\r
}\r
\r
+- (void)setNonActive:(id)noData\r
+{\r
+ b_nonActive = YES;\r
+ [self orderOut: self];\r
+}\r
+\r
+- (void)setActive:(id)noData\r
+{\r
+ b_nonActive = NO;\r
+ [self orderFront: self];\r
+}\r
+\r
/* This routine is called repeatedly to fade in the window */\r
- (void)focus:(NSTimer *)timer\r
{\r
- (void)fadeIn\r
{\r
/* in case that the user don't want us to appear, just return here */\r
- if(! config_GetInt( VLCIntf, "macosx-fspanel" ) )\r
+ if(! config_GetInt( VLCIntf, "macosx-fspanel" ) || b_nonActive )\r
return;\r
\r
if( [self alphaValue] < 1.0 )\r