summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-09-18 08:34:28 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2013-09-18 19:05:00 +0200
commita08802016dd6074819dbc77365e871dc7086f296 (patch)
tree74682411591369499f7a8ae159bb8a3d034470fa
parentfc74574df02e1f2414e7a9a43a94efc00bad3c26 (diff)
downloadmpv-a08802016dd6074819dbc77365e871dc7086f296.tar.bz2
mpv-a08802016dd6074819dbc77365e871dc7086f296.tar.xz
cocoa_common: override core's cursor visibility state
This keeps the state in sync with the current state in cocoa_common. Infact the cocoa code in mpv can decide wether it really wants to hide the cursor based on the result of the `canHideCursor` method (this is so that the cursor is only hidden when hovering on the video window).
-rw-r--r--video/out/cocoa_common.m8
1 files changed, 5 insertions, 3 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m
index 0c8a8bc7b4..d250cc2ec3 100644
--- a/video/out/cocoa_common.m
+++ b/video/out/cocoa_common.m
@@ -164,14 +164,16 @@ int vo_cocoa_init(struct vo *vo)
return 1;
}
-static void vo_cocoa_set_cursor_visibility(struct vo *vo, bool visible)
+static void vo_cocoa_set_cursor_visibility(struct vo *vo, bool *visible)
{
struct vo_cocoa_state *s = vo->cocoa;
- if (visible) {
+ if (*visible) {
CGDisplayShowCursor(kCGDirectMainDisplay);
} else if ([s->view canHideCursor]) {
CGDisplayHideCursor(kCGDirectMainDisplay);
+ } else {
+ *visible = true;
}
}
@@ -545,7 +547,7 @@ int vo_cocoa_control(struct vo *vo, int *events, int request, void *arg)
vo_cocoa_update_screen_info(vo);
return VO_TRUE;
case VOCTRL_SET_CURSOR_VISIBILITY:
- vo_cocoa_set_cursor_visibility(vo, *(bool *)arg);
+ vo_cocoa_set_cursor_visibility(vo, arg);
return VO_TRUE;
case VOCTRL_UPDATE_WINDOW_TITLE: {
cocoa_set_window_title(vo, (const char *) arg);