From 8fe357380ee9c784deb67423f8debbe5b5524016 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 17 May 2013 00:10:46 +0200 Subject: w32: use VOCTRL_SET_CURSOR_VISIBILITY This didn't even implement --cursor-autohide. Now it does, and the behavior of the VOs under Windows change accordingly. --- video/out/w32_common.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'video') diff --git a/video/out/w32_common.c b/video/out/w32_common.c index 5903a26f94..42a158a42f 100644 --- a/video/out/w32_common.c +++ b/video/out/w32_common.c @@ -417,11 +417,6 @@ static int reinit_window_state(struct vo *vo) layer = HWND_TOPMOST; // xxx not sure if this can trigger any unwanted messages (WM_MOVE/WM_SIZE) - if (vo->opts->fs) { - while (ShowCursor(0) >= 0) /**/ ; - } else { - while (ShowCursor(1) < 0) /**/ ; - } updateScreenProperties(vo); if (vo->opts->fs) { @@ -695,6 +690,12 @@ int vo_w32_control(struct vo *vo, int *events, int request, void *arg) case VOCTRL_UPDATE_SCREENINFO: w32_update_xinerama_info(vo); return VO_TRUE; + case VOCTRL_SET_CURSOR_VISIBILITY: + if (*(bool *)arg) { + while (ShowCursor(1) < 0) { } + } else { + while (ShowCursor(0) >= 0) { } + } } return VO_NOTIMPL; } @@ -712,7 +713,7 @@ void vo_w32_uninit(struct vo *vo) mp_msg(MSGT_VO, MSGL_V, "vo: win32: uninit\n"); if (!w32) return; - ShowCursor(1); + while (ShowCursor(1) < 0) { } DestroyWindow(w32->window); UnregisterClassW(classname, 0); talloc_free(w32); -- cgit v1.2.3