Browse Source

macosx: Only hide mouse if inside the video view

Ref #18658
pull/59/merge
Marvin Scholz 9 years ago
parent
commit
e418e3fa1a
  1. 2
      modules/gui/macosx/VLCVoutWindowController.h
  2. 21
      modules/gui/macosx/VLCVoutWindowController.m

2
modules/gui/macosx/VLCVoutWindowController.h

@ -46,4 +46,6 @@
- (void)updateWindowLevelForHelperWindows:(NSInteger)i_level;
- (void)hideMouseForWindow:(vout_window_t *)p_wnd;
@end

21
modules/gui/macosx/VLCVoutWindowController.m

@ -145,7 +145,7 @@ static int WindowControl(vout_window_t *p_wnd, int i_query, va_list args)
}
case VOUT_WINDOW_HIDE_MOUSE:
{
[NSCursor setHiddenUntilMouseMoves:YES];
[voutController hideMouseForWindow:p_wnd];
break;
}
default:
@ -215,6 +215,25 @@ void WindowClose(vout_window_t *p_wnd)
}
}
#pragma mark -
#pragma mark Mouse hiding
- (void)hideMouseForWindow:(vout_window_t *)p_wnd
{
VLCVideoWindowCommon *o_current_window = nil;
if (p_wnd)
o_current_window = [voutWindows objectForKey:[NSValue valueWithPointer:p_wnd]];
if (o_current_window == nil)
return;
if (NSPointInRect([o_current_window mouseLocationOutsideOfEventStream],
[[o_current_window videoView] convertRect:[[o_current_window videoView] bounds]
toView:nil])) {
[NSCursor setHiddenUntilMouseMoves:YES];
}
}
#pragma mark -
#pragma mark Methods for vout provider

Loading…
Cancel
Save