[vlc-commits] skins2: fix a video control that fails to show up

Erwan Tulou git at videolan.org
Tue Apr 28 16:38:58 CEST 2015


vlc/vlc-2.2 | branch: master | Erwan Tulou <erwan10 at videolan.org> | Tue Apr 28 15:32:12 2015 +0200| [88fa0c4b9d5196c53241fa27f2315ae6553d3808] | committer: Erwan Tulou

skins2: fix a video control that fails to show up

This fixes a regression in vlc2.2. It is described on the forum at :
https://forum.videolan.org/viewtopic.php?f=15&t=125790&sid=05f4d8a32853034ce6d497ca15bab1e8

(cherry picked from commit 7a00bd9b966fe6eb615d7df1b5ff6afdd92b2d36)
Signed-off-by: Erwan Tulou <erwan10 at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=88fa0c4b9d5196c53241fa27f2315ae6553d3808
---

 modules/gui/skins2/controls/ctrl_video.cpp |   36 +++++++++++++++-------------
 1 file changed, 20 insertions(+), 16 deletions(-)

diff --git a/modules/gui/skins2/controls/ctrl_video.cpp b/modules/gui/skins2/controls/ctrl_video.cpp
index 7c9dcae..c722755 100644
--- a/modules/gui/skins2/controls/ctrl_video.cpp
+++ b/modules/gui/skins2/controls/ctrl_video.cpp
@@ -113,6 +113,7 @@ void CtrlVideo::setLayout( GenericLayout *pLayout,
 {
     CtrlGeneric::setLayout( pLayout, rPosition );
     m_pLayout->getActiveVar().addObserver( this );
+    getWindow()->getVisibleVar().addObserver( this );
 
     // register Video Control
     VoutManager::instance( getIntf() )->registerCtrlVideo( this );
@@ -125,6 +126,7 @@ void CtrlVideo::setLayout( GenericLayout *pLayout,
 void CtrlVideo::unsetLayout()
 {
     m_pLayout->getActiveVar().delObserver( this );
+    getWindow()->getVisibleVar().delObserver( this );
     CtrlGeneric::unsetLayout();
 }
 
@@ -162,27 +164,28 @@ void CtrlVideo::resizeControl( int width, int height )
 void CtrlVideo::onUpdate( Subject<VarBool> &rVariable, void *arg  )
 {
     (void)arg;
+    VarBool &rFullscreen = VlcProc::instance( getIntf() )->getFullscreenVar();
 
-    // Visibility changed
     if( &rVariable == m_pVisible )
     {
-        msg_Dbg( getIntf(), "VideoCtrl : Visibility changed (visible=%d)",
-                                  isVisible() );
+        msg_Dbg( getIntf(), "VideoCtrl(%p) : control visibility changed (%i)",
+                      this, isVisible() );
         notifyLayout();
     }
-
-    // Active Layout changed
-    if( &rVariable == &m_pLayout->getActiveVar() )
+    else if( &rVariable == &m_pLayout->getActiveVar() )
     {
-        msg_Dbg( getIntf(), "VideoCtrl : Active Layout changed (isActive=%d)",
-                      m_pLayout->getActiveVar().get() );
+        msg_Dbg( getIntf(), "VideoCtrl(%p) : Active Layout changed (%i)",
+                      this, m_pLayout->getActiveVar().get() );
     }
-
-    VarBool &rFullscreen = VlcProc::instance( getIntf() )->getFullscreenVar();
-    if( &rVariable == &rFullscreen )
+    else if( &rVariable == &getWindow()->getVisibleVar() )
+    {
+        msg_Dbg( getIntf(), "VideoCtrl(%p) : Window visibility changed (%i)",
+                      this, getWindow()->getVisibleVar().get() );
+    }
+    else if( &rVariable == &rFullscreen )
     {
-        msg_Dbg( getIntf(), "VideoCtrl : fullscreen toggled (fullscreen = %d)",
-                      rFullscreen.get() );
+        msg_Dbg( getIntf(), "VideoCtrl(%p) : fullscreen toggled (%i)",
+                      this, rFullscreen.get() );
     }
 
     if( isUseable() && !isUsed() )
@@ -232,9 +235,10 @@ bool CtrlVideo::isUseable( ) const
 {
     VarBool &rFullscreen = VlcProc::instance( getIntf() )->getFullscreenVar();
 
-    return isVisible() &&                 // video control is visible
-           m_pLayout->isVisible() &&      // layout is visible
-           !rFullscreen.get();            // fullscreen is off
+    return isVisible()                           // video control is visible
+           && m_pLayout->getActiveVar().get()    // layout is active
+           && getWindow()->getVisibleVar().get() // window is visible
+           && !rFullscreen.get();                // fullscreen is off
 }
 
 



More information about the vlc-commits mailing list