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 )
if( i_width && i_height )
{
val.i_int = ( GET_X_LPARAM(msg.lParam) - i_x )
* p_event->p_vout->render.i_width / i_width;
val.i_int = ( GET_X_LPARAM(msg.lParam) - i_x ) *
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 );
val.i_int = ( GET_Y_LPARAM(msg.lParam) - i_y )
* p_event->p_vout->render.i_height / i_height;
val.i_int = ( GET_Y_LPARAM(msg.lParam) - i_y ) *
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 );
val.b_bool = VLC_TRUE;
......
......@@ -785,11 +785,13 @@ static int ManageVideo( vout_thread_t *p_vout )
p_vout->p_sys->p_win->i_height,
&i_x, &i_y, &i_width, &i_height );
val.i_int = ( xevent.xmotion.x - i_x )
* p_vout->render.i_width / i_width;
val.i_int = ( xevent.xmotion.x - i_x ) *
p_vout->fmt_in.i_visible_width / i_width +
p_vout->fmt_in.i_x_offset;
var_Set( p_vout, "mouse-x", val );
val.i_int = ( xevent.xmotion.y - i_y )
* p_vout->render.i_height / i_height;
val.i_int = ( xevent.xmotion.y - i_y ) *
p_vout->fmt_in.i_visible_height / i_height +
p_vout->fmt_in.i_y_offset;
var_Set( p_vout, "mouse-y", val );
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