[vlc-commits] macosx: also hide mouse cursor when detached window is in fullscreen
David Fuhrmann
git at videolan.org
Sat Feb 9 18:45:12 CET 2013
vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Sat Feb 9 11:07:44 2013 +0100| [13882691ddfd3ca2514febb3ece6b5d24893cdfe] | committer: David Fuhrmann
macosx: also hide mouse cursor when detached window is in fullscreen
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=13882691ddfd3ca2514febb3ece6b5d24893cdfe
---
modules/gui/macosx/MainWindow.h | 5 -----
modules/gui/macosx/MainWindow.m | 31 -------------------------------
modules/gui/macosx/Windows.m | 33 +++++++++++++++++++++++++++++++++
3 files changed, 33 insertions(+), 36 deletions(-)
diff --git a/modules/gui/macosx/MainWindow.h b/modules/gui/macosx/MainWindow.h
index 2f818c2..316845f 100644
--- a/modules/gui/macosx/MainWindow.h
+++ b/modules/gui/macosx/MainWindow.h
@@ -92,8 +92,6 @@
BOOL b_podcastView_displayed;
- NSTimer *t_hide_mouse_timer;
-
VLCColorView * o_color_backdrop;
NSRect frameBeforePlayback;
@@ -133,9 +131,6 @@
- (void)setVideoplayEnabled;
-- (void)hideMouseCursor:(NSTimer *)timer;
-- (void)recreateHideMouseTimer;
-
@end
@interface VLCDetachedVideoWindow : VLCVideoWindowCommon
diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index 81711ea..1da0e57 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -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
diff --git a/modules/gui/macosx/Windows.m b/modules/gui/macosx/Windows.m
index d7e1066..e314f4b 100644
--- a/modules/gui/macosx/Windows.m
+++ b/modules/gui/macosx/Windows.m
@@ -547,6 +547,39 @@
#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
- (void)becomeKeyWindow
More information about the vlc-commits
mailing list