Commit 872cb1ca authored by Gildas Bazin's avatar Gildas Bazin

* modules/video_output/directx, modules/video_output/x11: take cropping into...

* modules/video_output/directx, modules/video_output/x11: take cropping into account when reporting mouse coordinates.
parent 667f1889
...@@ -144,11 +144,13 @@ void E_(DirectXEventThread)( event_thread_t *p_event ) ...@@ -144,11 +144,13 @@ void E_(DirectXEventThread)( event_thread_t *p_event )
if( i_width && i_height ) if( i_width && i_height )
{ {
val.i_int = ( GET_X_LPARAM(msg.lParam) - i_x ) val.i_int = ( GET_X_LPARAM(msg.lParam) - i_x ) *
* p_event->p_vout->render.i_width / i_width; p_event->p_vout->fmt_in.i_visible_width / i_width +
p_event->p_vout->fmt_in.i_x_offset;
var_Set( p_event->p_vout, "mouse-x", val ); var_Set( p_event->p_vout, "mouse-x", val );
val.i_int = ( GET_Y_LPARAM(msg.lParam) - i_y ) val.i_int = ( GET_Y_LPARAM(msg.lParam) - i_y ) *
* p_event->p_vout->render.i_height / i_height; p_event->p_vout->fmt_in.i_visible_height / i_height +
p_event->p_vout->fmt_in.i_y_offset;
var_Set( p_event->p_vout, "mouse-y", val ); var_Set( p_event->p_vout, "mouse-y", val );
val.b_bool = VLC_TRUE; val.b_bool = VLC_TRUE;
......
...@@ -785,11 +785,13 @@ static int ManageVideo( vout_thread_t *p_vout ) ...@@ -785,11 +785,13 @@ static int ManageVideo( vout_thread_t *p_vout )
p_vout->p_sys->p_win->i_height, p_vout->p_sys->p_win->i_height,
&i_x, &i_y, &i_width, &i_height ); &i_x, &i_y, &i_width, &i_height );
val.i_int = ( xevent.xmotion.x - i_x ) val.i_int = ( xevent.xmotion.x - i_x ) *
* p_vout->render.i_width / i_width; p_vout->fmt_in.i_visible_width / i_width +
p_vout->fmt_in.i_x_offset;
var_Set( p_vout, "mouse-x", val ); var_Set( p_vout, "mouse-x", val );
val.i_int = ( xevent.xmotion.y - i_y ) val.i_int = ( xevent.xmotion.y - i_y ) *
* p_vout->render.i_height / i_height; p_vout->fmt_in.i_visible_height / i_height +
p_vout->fmt_in.i_y_offset;
var_Set( p_vout, "mouse-y", val ); var_Set( p_vout, "mouse-y", val );
val.b_bool = VLC_TRUE; val.b_bool = VLC_TRUE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment