diff --git a/modules/video_output/kva.c b/modules/video_output/kva.c index 34b9aae19a31a526be4ce3ec487793353bfda891..151d3dea62e15fd93926b79f97469493970ad376 100644 --- a/modules/video_output/kva.c +++ b/modules/video_output/kva.c @@ -103,6 +103,8 @@ struct vout_display_sys_t unsigned button_pressed; bool is_mouse_hidden; bool is_on_top; + mtime_t cursor_timeout; + mtime_t cursor_deadline; }; typedef struct @@ -391,32 +393,29 @@ static void Display( vout_display_t *vd, picture_t *picture, * here, WM_SIZE is not sent to its child window. * Maybe, is this due to the different threads ? */ WinPostMsg( sys->client, WM_VLC_MANAGE, 0, 0 ); -} - -/***************************************************************************** - * Control: control facility for the vout - *****************************************************************************/ -static int Control( vout_display_t *vd, int query, va_list args ) -{ - vout_display_sys_t *sys = vd->sys; - switch (query) - { - case VOUT_DISPLAY_HIDE_MOUSE: + if( !sys->is_mouse_hidden && sys->cursor_deadline < mdate() ) { POINTL ptl; WinQueryPointerPos( HWND_DESKTOP, &ptl ); - if( !sys->is_mouse_hidden && - WinWindowFromPoint( HWND_DESKTOP, &ptl, TRUE ) == sys->client ) + if( WinWindowFromPoint( HWND_DESKTOP, &ptl, TRUE ) == sys->client ) { WinShowPointer( HWND_DESKTOP, FALSE ); sys->is_mouse_hidden = true; } - - return VLC_SUCCESS; } +} +/***************************************************************************** + * Control: control facility for the vout + *****************************************************************************/ +static int Control( vout_display_t *vd, int query, va_list args ) +{ + vout_display_sys_t *sys = vd->sys; + + switch (query) + { case VOUT_DISPLAY_CHANGE_FULLSCREEN: { bool fs = va_arg(args, int); @@ -647,6 +646,10 @@ static int OpenDisplay( vout_display_t *vd, video_format_t *fmt ) psz_video_mode[ sys->kvac.ulMode - 1 ]); WinSetWindowText( sys->frame, sz_title ); + sys->cursor_timeout = var_InheritInteger( vd, "mouse-hide-timeout" ) + * (CLOCK_FREQ / 1000); + sys->cursor_deadline = INT64_MAX; + sys->i_screen_width = WinQuerySysValue( HWND_DESKTOP, SV_CXSCREEN ); sys->i_screen_height = WinQuerySysValue( HWND_DESKTOP, SV_CYSCREEN ); @@ -956,6 +959,7 @@ static MRESULT EXPENTRY WndProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ) { WinShowPointer(HWND_DESKTOP, TRUE); sys->is_mouse_hidden = false; + sys->cursor_deadline = mdate() + sys->cursor_timeout; } switch( msg )