- 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->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_SetBool( p_event->p_vout, "mouse-moved", true );
+ if( msg.hwnd == p_event->hvideownd )
+ {
+ /* Child window */
+ place.x = 0;
+ place.y = 0;
+ }
+ const int x = source.i_x_offset +
+ (int64_t)(GET_X_LPARAM(msg.lParam) - place.x) * source.i_width / place.width;
+ const int y = source.i_y_offset +
+ (int64_t)(GET_Y_LPARAM(msg.lParam) - place.y) * source.i_height / place.height;
+ vout_display_SendEventMouseMoved(vd, x, y);