summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-09-08 09:16:19 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2013-09-10 21:24:37 +0200
commit49849190dd1fe1d6d5d30502b504a73d63230536 (patch)
tree3ba87aa0ae12e2faf11fb915ec51099227b57821 /video
parent9f01797eac8b6f82e837761a988d06d1509df4de (diff)
downloadmpv-49849190dd1fe1d6d5d30502b504a73d63230536.tar.bz2
mpv-49849190dd1fe1d6d5d30502b504a73d63230536.tar.xz
cocoa_common: remove most of the special handling for cursor autohide
This is mostly related to the fullscreen behaviour. cecbd8864 introduces an option to make mpv behave like a OSX user would expect. This commit changes the Cocoa parts of the code to be consistent with the behaviour on X11. Old behaviour is still available through the option mentioned in cecbd8864. There is still custom logic in the cocoa backend and it can probably be moved to core: * Don't perform autohide if the mouse is down * Don't perform autohide outside of the video window Fixes #218 (by accident)
Diffstat (limited to 'video')
-rw-r--r--video/out/cocoa_common.m20
1 files changed, 3 insertions, 17 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m
index 200ceeafc7..0c8a8bc7b4 100644
--- a/video/out/cocoa_common.m
+++ b/video/out/cocoa_common.m
@@ -179,7 +179,6 @@ void vo_cocoa_uninit(struct vo *vo)
{
dispatch_sync(dispatch_get_main_queue(), ^{
struct vo_cocoa_state *s = vo->cocoa;
- vo_cocoa_set_cursor_visibility(vo, true);
enable_power_management(vo);
[NSApp setPresentationOptions:NSApplicationPresentationDefault];
@@ -545,11 +544,9 @@ int vo_cocoa_control(struct vo *vo, int *events, int request, void *arg)
case VOCTRL_UPDATE_SCREENINFO:
vo_cocoa_update_screen_info(vo);
return VO_TRUE;
- case VOCTRL_SET_CURSOR_VISIBILITY: {
- bool visible = *(bool *)arg;
- vo_cocoa_set_cursor_visibility(vo, visible);
+ case VOCTRL_SET_CURSOR_VISIBILITY:
+ vo_cocoa_set_cursor_visibility(vo, *(bool *)arg);
return VO_TRUE;
- }
case VOCTRL_UPDATE_WINDOW_TITLE: {
cocoa_set_window_title(vo, (const char *) arg);
return VO_TRUE;
@@ -691,14 +688,6 @@ int vo_cocoa_cgl_color_size(struct vo *vo)
[self toggleViewFullscreen:opts->fullscreen];
}
- // Do common work such as setting mouse visibility and actually setting
- // the new fullscreen state
- if (opts->fullscreen) {
- vo_cocoa_set_cursor_visibility(self.videoOutput, false);
- } else {
- vo_cocoa_set_cursor_visibility(self.videoOutput, true);
- }
-
[s->view recalcDraggableState];
// Change window size if the core attempted to change it while we were in
@@ -816,9 +805,7 @@ int vo_cocoa_cgl_color_size(struct vo *vo)
- (BOOL)canHideCursor
{
- struct vo *vo = self.videoOutput;
- return vo->opts->fullscreen && !self->hasMouseDown &&
- [self containsMouseLocation];
+ return !self->hasMouseDown && [self containsMouseLocation];
}
- (void)recalcDraggableState
@@ -842,7 +829,6 @@ int vo_cocoa_cgl_color_size(struct vo *vo)
- (void)mouseExited:(NSEvent *)event
{
cocoa_put_key(MP_KEY_MOUSE_LEAVE);
- vo_cocoa_set_cursor_visibility(self.videoOutput, true);
}
- (void)signalMouseMovement:(NSEvent *)event