mirror of
https://github.com/mpv-player/mpv
synced 2025-01-05 06:30:06 +00:00
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).
This commit is contained in:
parent
fc74574df0
commit
a08802016d
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user