+
+/*****************************************************************************
+ * SendEvents: forward mouse and keyboard events to the parent p_vout
+ *****************************************************************************/
+static int SendEvents( vlc_object_t *p_this, char const *psz_var,
+ vlc_value_t oldval, vlc_value_t newval, void *_p_vout )
+{
+ vout_thread_t *p_vout = (vout_thread_t *)_p_vout;
+ int i_vout;
+ vlc_value_t sentval = newval;
+
+ /* Find the video output index */
+ for( i_vout = 0; i_vout < p_vout->p_sys->i_vout; i_vout++ )
+ {
+ if( p_this == (vlc_object_t *)p_vout->p_sys->pp_vout[ i_vout ].p_vout )
+ {
+ break;
+ }
+ }
+
+ if( i_vout == p_vout->p_sys->i_vout )
+ {
+ return VLC_EGENERIC;
+ }
+
+ /* Translate the mouse coordinates */
+ if( !strcmp( psz_var, "mouse-x" ) )
+ {
+ sentval.i_int += p_vout->output.i_width
+ * (i_vout % p_vout->p_sys->i_col)
+ / p_vout->p_sys->i_col;
+ }
+ else if( !strcmp( psz_var, "mouse-y" ) )
+ {
+ sentval.i_int += p_vout->output.i_height
+ * (i_vout / p_vout->p_sys->i_row)
+ / p_vout->p_sys->i_row;
+ }
+
+ var_Set( p_vout, psz_var, sentval );
+
+ return VLC_SUCCESS;
+}
+
+/*****************************************************************************
+ * SendEventsToChild: forward events to the child/children vout
+ *****************************************************************************/
+static int SendEventsToChild( vlc_object_t *p_this, char const *psz_var,
+ vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+ vout_thread_t *p_vout = (vout_thread_t *)p_this;
+ int i_row, i_col, i_vout = 0;
+
+ for( i_row = 0; i_row < p_vout->p_sys->i_row; i_row++ )
+ {
+ for( i_col = 0; i_col < p_vout->p_sys->i_col; i_col++ )
+ {
+ var_Set( p_vout->p_sys->pp_vout[ i_vout ].p_vout, psz_var, newval);
+ if( !strcmp( psz_var, "fullscreen" ) ) break;
+ i_vout++;
+ }
+ }
+
+ return VLC_SUCCESS;
+}