vlc_linux/vlc-3.0.16/modules/gui/qt/components/controller.cpp
/**
 * Register and unregister callback for mouse moving
 */
Register and unregister callback for mouse moving
Register and unregister callback for mouse moving
void FullscreenControllerWidget::fullscreenChanged( vout_thread_t *p_vout,
        bool b_fs, int i_timeout )
{
    vlc_mutex_lock( &lock );
    if( b_fs && !b_fullscreen )
    {
        msg_Dbg( p_vout, "Qt: Entering Fullscreen" );
        b_fullscreen = true;
        i_hide_timeout = i_timeout;
        var_AddCallback( p_vout, "mouse-moved",
                FullscreenControllerWidgetMouseMoved, this );
    }
    else if( !b_fs && b_fullscreen )
    {
        msg_Dbg( p_vout, "Qt: Quitting Fullscreen" );
        b_fullscreen = false;
        i_hide_timeout = i_timeout;
        var_DelCallback( p_vout, "mouse-moved",
                FullscreenControllerWidgetMouseMoved, this );
        IMEvent *eHide = new IMEvent( IMEvent::FullscreenControlHide, 0 );
        QApplication::postEvent( this, eHide );
    }
    vlc_mutex_unlock( &lock );
}
void FullscreenControllerWidget :: fullscreenChanged ( vout_thread_t * p_vout , bool b_fs , int i_timeout ) { vlc_mutex_lock ( & lock ) ; if ( b_fs && ! b_fullscreen ) { msg_Dbg ( p_vout , " " ) ; b_fullscreen = true ; i_hide_timeout = i_timeout ; var_AddCallback ( p_vout , " " , FullscreenControllerWidgetMouseMoved , this ) ; } else if ( ! b_fs && b_fullscreen ) { msg_Dbg ( p_vout , " " ) ; b_fullscreen = false ; i_hide_timeout = i_timeout ; var_DelCallback ( p_vout , " " , FullscreenControllerWidgetMouseMoved , this ) ; IMEvent * eHide = new IMEvent ( IMEvent :: FullscreenControlHide , 0 ) ; QApplication :: postEvent ( this , eHide ) ; } vlc_mutex_unlock ( & lock ) ; }
Register and unregister callback for mouse moving
Register and unregister callback for mouse moving
/* FIXME - multiple vout (ie multiple mouse position ?) and thread safety if multiple vout ? */ /* Entering fullscreen, register callback */ /* Quitting fullscreen, unregistering callback */ /* Force fs hiding */