Only accept mouse coordinates inside video window

This commit is contained in:
Antoine Cellerier 2006-11-11 23:44:15 +00:00
parent 673861da5c
commit fb3133439d
1 changed files with 3 additions and 0 deletions

View File

@ -489,6 +489,9 @@ static int MouseEvent( vlc_object_t *p_this, char const *psz_var,
i_y = var_GetInteger( p_vout->p_sys->p_vout, "mouse-y" );
i_x = var_GetInteger( p_vout->p_sys->p_vout, "mouse-x" );
if( i_y < 0 || i_x < 0 || i_y >= v_h || i_x >= v_w )
return VLC_SUCCESS;
if( mouse & MOUSE_CLICKED )
{
i_pos = p_vout->p_sys->i_cols * ( ( p_vout->p_sys->i_rows * i_y ) / v_h ) + (p_vout->p_sys->i_cols * i_x ) / v_w;