From a08802016dd6074819dbc77365e871dc7086f296 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 18 Sep 2013 08:34:28 +0200 Subject: 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). --- video/out/cocoa_common.m | 8 +++++--- 1 file 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); -- cgit v1.2.3