]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/interface_widgets.cpp
Remove completely useless mutex
[vlc] / modules / gui / qt4 / components / interface_widgets.cpp
index 8f77aaaf1ec121b4d694362709add8aa12596ac5..66e4a9641c5b54ad2a9f897ccf8ed253426829b3 100644 (file)
@@ -60,7 +60,6 @@
 VideoWidget::VideoWidget( intf_thread_t *_p_i ) : QFrame( NULL ), p_intf( _p_i )
 {
     /* Init */
-    vlc_mutex_init( &lock );
     p_vout = NULL;
     hide(); setMinimumSize( 16, 16 );
     videoSize.rwidth() = -1;
@@ -75,9 +74,17 @@ VideoWidget::VideoWidget( intf_thread_t *_p_i ) : QFrame( NULL ), p_intf( _p_i )
     setAttribute( Qt::WA_PaintOnScreen, true );
 
     /* The core can ask through a callback to show the video. */
+#if HAS_QT43
     connect( this, SIGNAL(askVideoWidgetToShow( unsigned int, unsigned int)),
              this, SLOT(SetSizing(unsigned int, unsigned int )),
              Qt::BlockingQueuedConnection );
+#else
+#error This is broken. Fix it with a QEventLoop with a processEvents () 
+    connect( this, SIGNAL(askVideoWidgetToShow( unsigned int, unsigned int)),
+             this, SLOT(SetSizing(unsigned int, unsigned int )) );
+#endif
+
+
 }
 
 void VideoWidget::paintEvent(QPaintEvent *ev)
@@ -90,7 +97,6 @@ void VideoWidget::paintEvent(QPaintEvent *ev)
 
 VideoWidget::~VideoWidget()
 {
-    vlc_mutex_lock( &lock );
     if( p_vout )
     {
         if( !p_intf->psz_switch_intf )
@@ -104,8 +110,6 @@ VideoWidget::~VideoWidget()
                 vout_Control( p_vout, VOUT_CLOSE );
         }
     }
-    vlc_mutex_unlock( &lock );
-    vlc_mutex_destroy( &lock );
 }
 
 /**
@@ -462,7 +466,7 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
 
     BUTTON_SET_IMG( prevSectionButton, "", previous.png, "" );
     BUTTON_SET_IMG( nextSectionButton, "", next.png, "" );
-    BUTTON_SET_IMG( menuButton, "", previous.png, "" );
+    BUTTON_SET_IMG( menuButton, "", previous.png, qtr( "Menu" ) );
 
     discFrame->hide();
 
@@ -722,11 +726,8 @@ void ControlsWidget::next()
 
 void ControlsWidget::setNavigation( int navigation )
 {
-#define HELP_MENU N_( "Menu" )
 #define HELP_PCH N_( "Previous chapter" )
 #define HELP_NCH N_( "Next chapter" )
-#define HELP_PTR N_( "Previous track" )
-#define HELP_NTR N_( "Next track" )
 
     // 1 = chapter, 2 = title, 0 = no
     if( navigation == 0 )
@@ -873,7 +874,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 );
 
@@ -971,7 +972,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 */
@@ -1008,7 +1013,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()
@@ -1145,7 +1150,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;
@@ -1153,14 +1159,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;
 }