]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/interface_widgets.cpp
Enable asademux and csri in default configure..
[vlc] / modules / gui / qt4 / components / interface_widgets.cpp
index 710cc55a7216be2bfdb815d055d0d4080d538bac..207699ed46a3da8cfa48e9f77af6f789bf4be1e1 100644 (file)
@@ -60,8 +60,7 @@
 VideoWidget::VideoWidget( intf_thread_t *_p_i ) : QFrame( NULL ), p_intf( _p_i )
 {
     /* Init */
-    vlc_mutex_init( &lock );
-    p_vout = NULL;
+    i_vout = 0;
     hide(); setMinimumSize( 16, 16 );
     videoSize.rwidth() = -1;
     videoSize.rheight() = -1;
@@ -98,7 +97,9 @@ void VideoWidget::paintEvent(QPaintEvent *ev)
 
 VideoWidget::~VideoWidget()
 {
-    vlc_mutex_lock( &lock );
+    vout_thread_t *p_vout = i_vout
+        ? (vout_thread_t *)vlc_object_get( i_vout ) : NULL;
+
     if( p_vout )
     {
         if( !p_intf->psz_switch_intf )
@@ -111,9 +112,8 @@ VideoWidget::~VideoWidget()
             if( vout_Control( p_vout, VOUT_REPARENT ) != VLC_SUCCESS )
                 vout_Control( p_vout, VOUT_CLOSE );
         }
+        vlc_object_release( p_vout );
     }
-    vlc_mutex_unlock( &lock );
-    vlc_mutex_destroy( &lock );
 }
 
 /**
@@ -124,12 +124,12 @@ void *VideoWidget::request( vout_thread_t *p_nvout, int *pi_x, int *pi_y,
 {
     msg_Dbg( p_intf, "Video was requested %i, %i", *pi_x, *pi_y );
     emit askVideoWidgetToShow( *pi_width, *pi_height );
-    if( p_vout )
+    if( i_vout )
     {
         msg_Dbg( p_intf, "embedded video already in use" );
         return NULL;
     }
-    p_vout = p_nvout;
+    i_vout = p_nvout->i_object_id;
     msg_Dbg( p_intf, "embedded video ready (handle %p)", winId() );
     return ( void* )winId();
 }
@@ -148,8 +148,8 @@ void VideoWidget::SetSizing( unsigned int w, unsigned int h )
 
 void VideoWidget::release( void *p_win )
 {
-    msg_Dbg( p_intf, "Video is non needed anymore" );
-    p_vout = NULL;
+    msg_Dbg( p_intf, "Video is not needed anymore" );
+    i_vout = 0;
     videoSize.rwidth() = 0;
     videoSize.rheight() = 0;
     hide();
@@ -173,7 +173,7 @@ BackgroundWidget::BackgroundWidget( intf_thread_t *_p_i )
                  :QWidget( NULL ), p_intf( _p_i )
 {
     /* We should use that one to take the more size it can */
-//    setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
+    setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding);
 
     /* A dark background */
     setAutoFillBackground( true );
@@ -878,7 +878,7 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i,
         MainInterface *_p_mi, bool b_advControls, bool b_shiny )
         : ControlsWidget( _p_i, _p_mi, b_advControls, b_shiny, true ),
         i_lastPosX( -1 ), i_lastPosY( -1 ), i_hideTimeout( 1 ),
-        b_mouseIsOver( false )
+        b_mouseIsOver( false ), b_isFullscreen( false )
 {
     setWindowFlags( Qt::ToolTip );
 
@@ -976,7 +976,11 @@ void FullscreenControllerWidget::slowHideFSC()
     }
     else
     {
+#ifdef WIN32TRICK
+         if ( windowOpacity() > 0.0 && !fscHidden )
+#else
          if ( windowOpacity() > 0.0 )
+#endif
          {
              /* we should use 0.01 because of 100 pieces ^^^
                 but than it cannt be done in time */
@@ -1013,7 +1017,7 @@ void FullscreenControllerWidget::customEvent( QEvent *event )
 {
     int type = event->type();
 
-    if ( type == FullscreenControlShow_Type )
+    if ( type == FullscreenControlShow_Type && b_isFullscreen )
     {
         #ifdef WIN32TRICK
         // after quiting and going to fs, we need to call show()
@@ -1150,7 +1154,8 @@ static int regMouseMoveCallback( vlc_object_t *vlc_object, const char *variable,
 
     if ( var_GetBool( p_vout, "fullscreen" ) && !b_registered )
     {
-        p_fs->SetHideTimeout( var_GetInteger( p_vout, "mouse-hide-timeout" ) );
+        p_fs->setHideTimeout( var_GetInteger( p_vout, "mouse-hide-timeout" ) );
+        p_fs->setIsFullscreen( true );
         var_AddCallback( p_vout, "mouse-moved",
                         showFullscreenControllCallback, (void *) p_fs );
         b_registered = true;
@@ -1158,14 +1163,13 @@ static int regMouseMoveCallback( vlc_object_t *vlc_object, const char *variable,
 
     if ( !var_GetBool( p_vout, "fullscreen" ) && b_registered )
     {
+        p_fs->setIsFullscreen( false );
+        p_fs->hide();
         var_DelCallback( p_vout, "mouse-moved",
                         showFullscreenControllCallback, (void *) p_fs );
         b_registered = false;
     }
 
-    if ( !var_GetBool( p_vout, "fullscreen" ) )
-        p_fs->hide();
-
     return VLC_SUCCESS;
 }