Commit 015cca91 authored by Felix Paul Kühne's avatar Felix Paul Kühne

windowed mac plugin: hide toolbar after 4 secs of mouse inactivity

parent e1176ec7
......@@ -88,6 +88,7 @@
@interface VLCFullscreenContentView : NSView {
VlcPluginMac *_cppPlugin;
NSTimeInterval _timeSinceLastMouseMove;
}
@property (readwrite) VlcPluginMac * cppPlugin;
......@@ -984,9 +985,19 @@ static CGImageRef createImageNamed(NSString *name)
- (void)mouseMoved:(NSEvent *)theEvent
{
self.cppPlugin->set_toolbar_visible(true);
_timeSinceLastMouseMove = [NSDate timeIntervalSinceReferenceDate];
[self performSelector:@selector(hideToolbar) withObject:nil afterDelay: 4.1];
[super mouseMoved: theEvent];
}
- (void)hideToolbar
{
if ([NSDate timeIntervalSinceReferenceDate] - _timeSinceLastMouseMove >= 4) {
self.cppPlugin->set_toolbar_visible(false);
[NSCursor setHiddenUntilMouseMoves:YES];
}
}
@end
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