]> git.sesse.net Git - vlc/commitdiff
macosx: try to correctly hide fspanel
authorDavid Fuhrmann <david.fuhrmann@googlemail.com>
Sun, 2 Jun 2013 10:00:18 +0000 (12:00 +0200)
committerDavid Fuhrmann <david.fuhrmann@googlemail.com>
Thu, 6 Jun 2013 19:10:11 +0000 (21:10 +0200)
hopefully fixes #8489

modules/gui/macosx/MainWindow.m
modules/gui/macosx/fspanel.m
modules/gui/macosx/intf.m

index 8938bb0da2339f75e1bdd83d2e49656f5b923d97..a3f2cfece5e55573ebba5df2834b12d50627f2c1 100644 (file)
@@ -802,7 +802,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
 
 - (void)showFullscreenController
 {
-
     id currentWindow = [NSApp keyWindow];
     if ([currentWindow respondsToSelector:@selector(hasActiveVideo)] && [currentWindow hasActiveVideo]) {
         if ([currentWindow respondsToSelector:@selector(fullscreen)] && [currentWindow fullscreen] && ![[currentWindow videoView] isHidden]) {
@@ -810,10 +809,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
             if ([[VLCMain sharedInstance] activeVideoPlayback])
                 [o_fspanel fadeIn];
         }
-
     }
 
-
 }
 
 - (void)makeKeyAndOrderFront: (id)sender
index fa145ad2dc7416e03a6228e15b57ec5ba2475298..76cc10210cc410e4bebc5e0fbe0de40e6d87714c 100644 (file)
@@ -72,6 +72,8 @@
     if (!isInside)
         [self mouseExited:NULL];
 
+    [self setAnimationBehavior:NSWindowAnimationBehaviorNone];
+
     /* get a notification if VLC isn't the active app anymore */
     [[NSNotificationCenter defaultCenter]
     addObserver: self
@@ -79,7 +81,8 @@
            name: NSApplicationDidResignActiveNotification
          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]
     addObserver: self
        selector: @selector(setActive:)
 - (void)setNonActive:(id)noData
 {
     b_nonActive = YES;
-    [self orderOut: self];
 
     /* here's fadeOut, just without visibly fading */
     b_displayed = NO;
     [self setAlphaValue:0.0];
     [self setFadeTimer:nil];
+
     b_fadeQueued = NO;
+
+    [self orderOut: self];
 }
 
 - (void)setActive:(id)noData
         b_voutWasUpdated = NO;
     }
 
-    if ([self alphaValue] < 1.0)
+    if ([self alphaValue] < 1.0) {
         [self setAlphaValue:[self alphaValue]+0.1];
+    }
     if ([self alphaValue] >= 1.0) {
         b_displayed = YES;
         [self setAlphaValue: 1.0];
         [self fadeIn];
         return;
     }
-    if ([self alphaValue] > 0.0)
+    if ([self alphaValue] > 0.0) {
         [self setAlphaValue:[self alphaValue]-0.05];
+    }
     if ([self alphaValue] <= 0.05) {
         b_displayed = NO;
         [self setAlphaValue:0.0];
     b_keptVisible = YES;
 
     /* get us a valid timer */
-    if (! b_alreadyCounting) {
+    if (!b_alreadyCounting) {
         i_timeToKeepVisibleInSec = var_CreateGetInteger(VLCIntf, "mouse-hide-timeout") / 500;
         if (hideAgainTimer) {
             [hideAgainTimer invalidate];
index c07c779ee41eeebed963d186e951830e9bebf840..fc8e9902708293bf2931cfd5c90e09957961253e 100644 (file)
@@ -1379,6 +1379,8 @@ static VLCMain *_o_sharedMainInstance = nil;
 
 - (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];
 }