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

* 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 @@ ...@@ -31,6 +31,7 @@
BOOL b_alreadyCounting; BOOL b_alreadyCounting;
int i_timeToKeepVisibleInSec; int i_timeToKeepVisibleInSec;
BOOL b_nonActive;
BOOL b_displayed; BOOL b_displayed;
BOOL b_voutWasUpdated; BOOL b_voutWasUpdated;
int i_device; int i_device;
...@@ -50,6 +51,9 @@ ...@@ -50,6 +51,9 @@
- (void)setSeekable:(BOOL) b_seekable; - (void)setSeekable:(BOOL) b_seekable;
- (void)setVolumeLevel: (float)f_volumeLevel; - (void)setVolumeLevel: (float)f_volumeLevel;
- (void)setNonActive:(id)noData;
- (void)setActive:(id)noData;
- (void)focus:(NSTimer *)timer; - (void)focus:(NSTimer *)timer;
- (void)unfocus:(NSTimer *)timer; - (void)unfocus:(NSTimer *)timer;
- (void)mouseExited:(NSEvent *)theEvent; - (void)mouseExited:(NSEvent *)theEvent;
......
...@@ -65,6 +65,20 @@ ...@@ -65,6 +65,20 @@
[self mouseEntered:NULL]; [self mouseEntered:NULL];
if (!isInside) if (!isInside)
[self mouseExited:NULL]; [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 */ /* Windows created with NSBorderlessWindowMask normally can't be key, but we want ours to be */
...@@ -80,6 +94,8 @@ ...@@ -80,6 +94,8 @@
-(void)dealloc -(void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver: self];
if( hideAgainTimer ) if( hideAgainTimer )
[hideAgainTimer release]; [hideAgainTimer release];
[self setFadeTimer:nil]; [self setFadeTimer:nil];
...@@ -137,6 +153,18 @@ ...@@ -137,6 +153,18 @@
[[self contentView] setVolumeLevel: f_volumeLevel]; [[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 */ /* This routine is called repeatedly to fade in the window */
- (void)focus:(NSTimer *)timer - (void)focus:(NSTimer *)timer
{ {
...@@ -204,7 +232,7 @@ ...@@ -204,7 +232,7 @@
- (void)fadeIn - (void)fadeIn
{ {
/* in case that the user don't want us to appear, just return here */ /* 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; return;
if( [self alphaValue] < 1.0 ) if( [self alphaValue] < 1.0 )
......
Supports Markdown
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