]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins2/src/window_manager.cpp
skins2: add support for --[no]-video-on-top (fix #685)
[vlc] / modules / gui / skins2 / src / window_manager.cpp
index b2ccf99913ed0479a4ce7d85e55b10cccb9020c3..d2c8b8ea437c45d4c82e5179bb457786d1648ffb 100644 (file)
@@ -71,7 +71,6 @@ void WindowManager::startMove( TopWindow &rWindow )
     m_movingWindows.clear();
     buildDependSet( m_movingWindows, &rWindow );
 
-#ifdef WIN32
     if( config_GetInt( getIntf(), "skins2-transparency" ) )
     {
         // Change the opacity of the moving windows
@@ -89,7 +88,6 @@ void WindowManager::startMove( TopWindow &rWindow )
             (*it)->refresh( 0, 0, (*it)->getWidth(), (*it)->getHeight() );
         }
     }
-#endif
 }
 
 
@@ -98,7 +96,6 @@ void WindowManager::stopMove()
     WinSet_t::const_iterator itWin1, itWin2;
     AncList_t::const_iterator itAnc1, itAnc2;
 
-#ifdef WIN32
     if( config_GetInt( getIntf(), "skins2-transparency" ) )
     {
         // Restore the opacity of the moving windows
@@ -108,7 +105,6 @@ void WindowManager::stopMove()
             (*it)->setOpacity( m_alpha );
         }
     }
-#endif
 
     // Delete the dependencies
     m_dependencies.clear();
@@ -429,7 +425,6 @@ void WindowManager::showAll( bool firstTime ) const
         {
             (*it)->show();
         }
-        (*it)->setOpacity( m_alpha );
     }
 }
 
@@ -444,21 +439,29 @@ void WindowManager::hideAll() const
 }
 
 
-void WindowManager::toggleOnTop()
+void WindowManager::setOnTop( bool b_ontop )
 {
     // Update the boolean variable
     VarBoolImpl *pVarOnTop = (VarBoolImpl*)m_cVarOnTop.get();
-    pVarOnTop->set( !pVarOnTop->get() );
+    pVarOnTop->set( b_ontop );
 
-    // Toggle the "on top" status
+    // set/unset the "on top" status
     WinSet_t::const_iterator it;
     for( it = m_allWindows.begin(); it != m_allWindows.end(); it++ )
     {
-        (*it)->toggleOnTop( pVarOnTop->get() );
+        (*it)->toggleOnTop( b_ontop );
     }
 }
 
 
+void WindowManager::toggleOnTop()
+{
+    VarBoolImpl *pVarOnTop = (VarBoolImpl*)m_cVarOnTop.get();
+
+    setOnTop( !pVarOnTop->get() );
+}
+
+
 void WindowManager::buildDependSet( WinSet_t &rWinSet,
                                     TopWindow *pWindow )
 {
@@ -639,3 +642,4 @@ void WindowManager::setActiveLayout( TopWindow &rWindow,
     // Rebuild the dependencies
     stopMove();
 }
+