]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins2/src/window_manager.cpp
* skins2: support for custom popup menus, and win32 implementation.
[vlc] / modules / gui / skins2 / src / window_manager.cpp
old mode 100755 (executable)
new mode 100644 (file)
index d8d5621..db36429
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * window_manager.cpp
  *****************************************************************************
- * Copyright (C) 2003 VideoLAN
+ * Copyright (C) 2003 the VideoLAN team
  * $Id$
  *
  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
@@ -33,7 +33,7 @@
 
 
 WindowManager::WindowManager( intf_thread_t *pIntf ):
-    SkinObject( pIntf ), m_magnet( 0 ), m_pTooltip( NULL )
+    SkinObject( pIntf ), m_magnet( 0 ), m_pTooltip( NULL ), m_pPopup( NULL )
 {
     // Create and register a variable for the "on top" status
     VarManager *pVarManager = VarManager::instance( getIntf() );
@@ -195,13 +195,18 @@ void WindowManager::raiseAll() const
 }
 
 
-void WindowManager::showAll() const
+void WindowManager::showAll( bool firstTime ) const
 {
     // Show all the windows
     WinSet_t::const_iterator it;
     for( it = m_allWindows.begin(); it != m_allWindows.end(); it++ )
     {
-        (*it)->show();
+        // When the theme is opened for the first time,
+        // only show the window if set as visible in the XML
+        if ((*it)->isVisible() || !firstTime)
+        {
+            (*it)->show();
+        }
         (*it)->setOpacity( m_alpha );
     }
 }
@@ -264,6 +269,12 @@ void WindowManager::checkAnchors( TopWindow *pWindow,
     for( itMov = m_movingWindows.begin();
          itMov != m_movingWindows.end(); itMov++ )
     {
+        // Skip the invisible windows
+        if( ! (*itMov)->getVisibleVar().get() )
+        {
+            continue;
+        }
+
         int newLeft = (*itMov)->getLeft() + xOffset;
         int newTop = (*itMov)->getTop() + yOffset;
         if( newLeft > workArea.getLeft() - m_magnet &&