Commit 9203b452 authored by Felix Paul Kühne's avatar Felix Paul Kühne

* hide the fspanel if VLC looses its front app state in fullscreen mode (by...

* hide the fspanel if VLC looses its front app state in fullscreen mode (by using the app switcher, etc.)
parent b28e4125
......@@ -31,6 +31,7 @@
BOOL b_alreadyCounting;
int i_timeToKeepVisibleInSec;
BOOL b_nonActive;
BOOL b_displayed;
BOOL b_voutWasUpdated;
int i_device;
......@@ -50,6 +51,9 @@
- (void)setSeekable:(BOOL) b_seekable;
- (void)setVolumeLevel: (float)f_volumeLevel;
- (void)setNonActive:(id)noData;
- (void)setActive:(id)noData;
- (void)focus:(NSTimer *)timer;
- (void)unfocus:(NSTimer *)timer;
- (void)mouseExited:(NSEvent *)theEvent;
......
......@@ -65,6 +65,20 @@
[self mouseEntered:NULL];
if (!isInside)
[self mouseExited:NULL];
/* get a notification if VLC isn't the active app anymore */
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(setNonActive:)
name: NSApplicationDidResignActiveNotification
object: NSApp];
/* get a notification if VLC is the active app again */
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(setActive:)
name: NSApplicationDidBecomeActiveNotification
object: NSApp];
}
/* Windows created with NSBorderlessWindowMask normally can't be key, but we want ours to be */
......@@ -80,6 +94,8 @@
-(void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver: self];
if( hideAgainTimer )
[hideAgainTimer release];
[self setFadeTimer:nil];
......@@ -137,6 +153,18 @@
[[self contentView] setVolumeLevel: f_volumeLevel];
}
- (void)setNonActive:(id)noData
{
b_nonActive = YES;
[self orderOut: self];
}
- (void)setActive:(id)noData
{
b_nonActive = NO;
[self orderFront: self];
}
/* This routine is called repeatedly to fade in the window */
- (void)focus:(NSTimer *)timer
{
......@@ -204,7 +232,7 @@
- (void)fadeIn
{
/* in case that the user don't want us to appear, just return here */
if(! config_GetInt( VLCIntf, "macosx-fspanel" ) )
if(! config_GetInt( VLCIntf, "macosx-fspanel" ) || b_nonActive )
return;
if( [self alphaValue] < 1.0 )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment