+ p_sys->b_update = p_sys->b_visible ? true : false;
+ return VLC_SUCCESS;
+}
+
+/*****************************************************************************
+ * MouseEvent: callback for mouse events
+ *****************************************************************************/
+static int MouseEvent( vlc_object_t *p_this, char const *psz_var,
+ vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+ VLC_UNUSED(oldval);
+ filter_sys_t *p_sys = (filter_sys_t *)p_data;
+ vout_thread_t *p_vout = (vout_thread_t*)p_sys->p_vout;
+ int i_x = newval.coords.x;
+ int i_y = newval.coords.y;
+ int v_h = p_vout->output.i_height;
+ int v_w = p_vout->output.i_width;
+
+ if( i_y < 0 || i_x < 0 || i_y >= v_h || i_x >= v_w )
+ return VLC_SUCCESS;
+
+ do
+ {
+ int i_scale_width, i_scale_height;
+ osd_button_t *p_button = NULL;
+
+ i_scale_width = p_vout->fmt_out.i_visible_width * 1000 /
+ p_vout->fmt_in.i_visible_width;
+ i_scale_height = p_vout->fmt_out.i_visible_height * 1000 /
+ p_vout->fmt_in.i_visible_height;
+
+ p_button = osd_ButtonFind( p_this, i_x, i_y, v_h, v_w,
+ i_scale_width, i_scale_height );
+ if( p_button )
+ {
+ osd_ButtonSelect( p_this, p_button );
+ p_sys->b_update = p_sys->b_visible ? true : false;
+ p_sys->b_clicked = true;
+ msg_Dbg( p_this, "mouse clicked %s (%d,%d)", p_button->psz_name, i_x, i_y );
+ }
+ }
+ while(0);