macosx: also hide mouse cursor when detached window is in fullscreen
authorDavid Fuhrmann <david.fuhrmann@googlemail.com>
Sat, 9 Feb 2013 10:07:44 +0000 (11:07 +0100)
committerDavid Fuhrmann <david.fuhrmann@googlemail.com>
Sat, 9 Feb 2013 17:44:40 +0000 (18:44 +0100)
modules/gui/macosx/MainWindow.h
modules/gui/macosx/MainWindow.m
modules/gui/macosx/Windows.m

index 2f818c2..316845f 100644 (file)
@@ -92,8 +92,6 @@
 
     BOOL b_podcastView_displayed;
 
-    NSTimer *t_hide_mouse_timer;
-
     VLCColorView * o_color_backdrop;
 
     NSRect frameBeforePlayback;
 
 - (void)setVideoplayEnabled;
 
-- (void)hideMouseCursor:(NSTimer *)timer;
-- (void)recreateHideMouseTimer;
-
 @end
 
 @interface VLCDetachedVideoWindow : VLCVideoWindowCommon
index 81711ea..1da0e57 100644 (file)
@@ -158,7 +158,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
     if (!OSX_SNOW_LEOPARD)
         b_nativeFullscreenMode = var_InheritBool(VLCIntf, "macosx-nativefullscreenmode");
 #endif
-    t_hide_mouse_timer = nil;
     [self useOptimizedDrawing: YES];
 
     [[o_search_fld cell] setPlaceholderString: _NS("Search")];
@@ -756,36 +755,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
     }
 }
 
-//  Called automatically if window's acceptsMouseMovedEvents property is true
-- (void)mouseMoved:(NSEvent *)theEvent
-{
-    if (b_fullscreen)
-        [self recreateHideMouseTimer];
-
-    [super mouseMoved: theEvent];
-}
-
-- (void)recreateHideMouseTimer
-{
-    if (t_hide_mouse_timer != nil) {
-        [t_hide_mouse_timer invalidate];
-        [t_hide_mouse_timer release];
-    }
-
-    t_hide_mouse_timer = [NSTimer scheduledTimerWithTimeInterval:2
-                                                          target:self
-                                                        selector:@selector(hideMouseCursor:)
-                                                        userInfo:nil
-                                                         repeats:NO];
-    [t_hide_mouse_timer retain];
-}
-
-//  NSTimer selectors require this function signature as per Apple's docs
-- (void)hideMouseCursor:(NSTimer *)timer
-{
-    [NSCursor setHiddenUntilMouseMoves: YES];
-}
-
 #pragma mark -
 #pragma mark Lion native fullscreen handling
 - (void)windowWillEnterFullScreen:(NSNotification *)notification
index d7e1066..e314f4b 100644 (file)
 }
 
 
+#pragma mark -
+#pragma mark Mouse cursor handling
+
+//  NSTimer selectors require this function signature as per Apple's docs
+- (void)hideMouseCursor:(NSTimer *)timer
+{
+    [NSCursor setHiddenUntilMouseMoves: YES];
+}
+
+- (void)recreateHideMouseTimer
+{
+    if (t_hide_mouse_timer != nil) {
+        [t_hide_mouse_timer invalidate];
+        [t_hide_mouse_timer release];
+    }
+
+    t_hide_mouse_timer = [NSTimer scheduledTimerWithTimeInterval:2
+                                                          target:self
+                                                        selector:@selector(hideMouseCursor:)
+                                                        userInfo:nil
+                                                         repeats:NO];
+    [t_hide_mouse_timer retain];
+}
+
+//  Called automatically if window's acceptsMouseMovedEvents property is true
+- (void)mouseMoved:(NSEvent *)theEvent
+{
+    if (b_fullscreen)
+        [self recreateHideMouseTimer];
+
+    [super mouseMoved: theEvent];
+}
+
 #pragma mark -
 #pragma mark Lion native fullscreen handling