]> git.sesse.net Git - vlc/commitdiff
macosx: Fix #1802 Cursor not hidden if fullscreen controller is disabled (OS X).
authorPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 1 Aug 2008 19:33:36 +0000 (21:33 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 1 Aug 2008 19:50:37 +0000 (21:50 +0200)
modules/gui/macosx/fspanel.m

index ae252bac01434738eb7005dc481ab2f474601286..d3ceab14d3df584771270492ab28288ac5e5e3ad 100644 (file)
 #import "misc.h"
 #import "fspanel.h"
 
+@interface VLCFSPanel ()
+- (void)hideMouse;
+@end
+
 /*****************************************************************************
  * VLCFSPanel
  *****************************************************************************/
         [[[[[VLCMain sharedInstance] getControls] getVoutView] window] makeKeyWindow];
 }
 
+- (void)hideMouse
+{
+    [NSCursor setHiddenUntilMouseMoves: YES];
+}
+
 - (void)fadeIn
 {
-    /* in case that the user don't want us to appear, just return here */
-    if(! config_GetInt( VLCIntf, "macosx-fspanel" ) || b_nonActive )
+    /* in case that the user don't want us to appear, make sure we hide the mouse */
+
+    if( !config_GetInt( VLCIntf, "macosx-fspanel" ) )
+    {
+        float time = (float)var_CreateGetInteger( VLCIntf, "mouse-hide-timeout" ) / 1000.;
+        [self setFadeTimer:[NSTimer scheduledTimerWithTimeInterval:time target:self selector:@selector(hideMouse) userInfo:nil repeats:NO]];
+        return;
+    }
+
+    if( b_nonActive )
         return;
 
     [self orderFront: nil];
     /* count down until we hide ourselfes again and do so if necessary */
     if( --i_timeToKeepVisibleInSec < 1 )
     {
-        [NSCursor setHiddenUntilMouseMoves: YES];
+        [self hideMouse];
         [self fadeOut];
         [hideAgainTimer invalidate]; /* released in -autoHide and -dealloc */
         b_alreadyCounting = NO;