Commit 13882691 authored by David Fuhrmann's avatar David Fuhrmann

macosx: also hide mouse cursor when detached window is in fullscreen

parent 20c4f1a9
......@@ -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
......
......@@ -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
......
......@@ -546,6 +546,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
......
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