Commit daf2eb53 authored by David Fuhrmann's avatar David Fuhrmann

macosx: try to correctly hide fspanel

hopefully fixes #8489
parent b92728c2
...@@ -802,7 +802,6 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -802,7 +802,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (void)showFullscreenController - (void)showFullscreenController
{ {
id currentWindow = [NSApp keyWindow]; id currentWindow = [NSApp keyWindow];
if ([currentWindow respondsToSelector:@selector(hasActiveVideo)] && [currentWindow hasActiveVideo]) { if ([currentWindow respondsToSelector:@selector(hasActiveVideo)] && [currentWindow hasActiveVideo]) {
if ([currentWindow respondsToSelector:@selector(fullscreen)] && [currentWindow fullscreen] && ![[currentWindow videoView] isHidden]) { if ([currentWindow respondsToSelector:@selector(fullscreen)] && [currentWindow fullscreen] && ![[currentWindow videoView] isHidden]) {
...@@ -810,10 +809,8 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -810,10 +809,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
if ([[VLCMain sharedInstance] activeVideoPlayback]) if ([[VLCMain sharedInstance] activeVideoPlayback])
[o_fspanel fadeIn]; [o_fspanel fadeIn];
} }
} }
} }
- (void)makeKeyAndOrderFront: (id)sender - (void)makeKeyAndOrderFront: (id)sender
......
...@@ -72,6 +72,8 @@ ...@@ -72,6 +72,8 @@
if (!isInside) if (!isInside)
[self mouseExited:NULL]; [self mouseExited:NULL];
[self setAnimationBehavior:NSWindowAnimationBehaviorNone];
/* get a notification if VLC isn't the active app anymore */ /* get a notification if VLC isn't the active app anymore */
[[NSNotificationCenter defaultCenter] [[NSNotificationCenter defaultCenter]
addObserver: self addObserver: self
...@@ -79,7 +81,8 @@ ...@@ -79,7 +81,8 @@
name: NSApplicationDidResignActiveNotification name: NSApplicationDidResignActiveNotification
object: NSApp]; object: NSApp];
/* get a notification if VLC is the active app again */ /* Get a notification if VLC is the active app again.
Needed as becomeKeyWindow does not get called when window is activated by clicking */
[[NSNotificationCenter defaultCenter] [[NSNotificationCenter defaultCenter]
addObserver: self addObserver: self
selector: @selector(setActive:) selector: @selector(setActive:)
...@@ -170,13 +173,15 @@ ...@@ -170,13 +173,15 @@
- (void)setNonActive:(id)noData - (void)setNonActive:(id)noData
{ {
b_nonActive = YES; b_nonActive = YES;
[self orderOut: self];
/* here's fadeOut, just without visibly fading */ /* here's fadeOut, just without visibly fading */
b_displayed = NO; b_displayed = NO;
[self setAlphaValue:0.0]; [self setAlphaValue:0.0];
[self setFadeTimer:nil]; [self setFadeTimer:nil];
b_fadeQueued = NO; b_fadeQueued = NO;
[self orderOut: self];
} }
- (void)setActive:(id)noData - (void)setActive:(id)noData
...@@ -195,8 +200,9 @@ ...@@ -195,8 +200,9 @@
b_voutWasUpdated = NO; b_voutWasUpdated = NO;
} }
if ([self alphaValue] < 1.0) if ([self alphaValue] < 1.0) {
[self setAlphaValue:[self alphaValue]+0.1]; [self setAlphaValue:[self alphaValue]+0.1];
}
if ([self alphaValue] >= 1.0) { if ([self alphaValue] >= 1.0) {
b_displayed = YES; b_displayed = YES;
[self setAlphaValue: 1.0]; [self setAlphaValue: 1.0];
...@@ -218,8 +224,9 @@ ...@@ -218,8 +224,9 @@
[self fadeIn]; [self fadeIn];
return; return;
} }
if ([self alphaValue] > 0.0) if ([self alphaValue] > 0.0) {
[self setAlphaValue:[self alphaValue]-0.05]; [self setAlphaValue:[self alphaValue]-0.05];
}
if ([self alphaValue] <= 0.05) { if ([self alphaValue] <= 0.05) {
b_displayed = NO; b_displayed = NO;
[self setAlphaValue:0.0]; [self setAlphaValue:0.0];
...@@ -292,7 +299,7 @@ ...@@ -292,7 +299,7 @@
b_keptVisible = YES; b_keptVisible = YES;
/* get us a valid timer */ /* get us a valid timer */
if (! b_alreadyCounting) { if (!b_alreadyCounting) {
i_timeToKeepVisibleInSec = var_CreateGetInteger(VLCIntf, "mouse-hide-timeout") / 500; i_timeToKeepVisibleInSec = var_CreateGetInteger(VLCIntf, "mouse-hide-timeout") / 500;
if (hideAgainTimer) { if (hideAgainTimer) {
[hideAgainTimer invalidate]; [hideAgainTimer invalidate];
......
...@@ -1379,6 +1379,8 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1379,6 +1379,8 @@ static VLCMain *_o_sharedMainInstance = nil;
- (void)showFullscreenController - (void)showFullscreenController
{ {
// defer selector here (possibly another time) to ensure that keyWindow is set properly
// (needed for NSApplicationDidBecomeActiveNotification)
[o_mainwindow performSelectorOnMainThread:@selector(showFullscreenController) withObject:nil waitUntilDone:NO]; [o_mainwindow performSelectorOnMainThread:@selector(showFullscreenController) withObject:nil waitUntilDone:NO];
} }
......
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