]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwidgets/video.cpp
* modules/video_output/x11/xcommon.c, modules/gui/wxwidgets/video.cpp, modules/gui...
[vlc] / modules / gui / wxwidgets / video.cpp
index e94356b3f0b7d0728c83eceafe530b50d88d4dcd..e6fe8d2b745d04cd9126b5352972e9d4f159abd3 100644 (file)
@@ -18,7 +18,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -70,7 +70,9 @@ wxWindow *CreateVideoWindow( intf_thread_t *p_intf, wxWindow *p_parent )
 
 void UpdateVideoWindow( intf_thread_t *p_intf, wxWindow *p_window )
 {
-#if (wxCHECK_VERSION(2,5,0))
+#if wxCHECK_VERSION(2,5,3)
+    if( !p_intf->p_sys->b_video_autosize ) return;
+
     if( p_window && mdate() - ((VideoWindow *)p_window)->i_creation_date < 2000000 )
         return; /* Hack to prevent saving coordinates if window is not yet
                  * properly created. Yuck :( */
@@ -84,15 +86,16 @@ void UpdateVideoWindow( intf_thread_t *p_intf, wxWindow *p_window )
  * Constructor.
  *****************************************************************************/
 VideoWindow::VideoWindow( intf_thread_t *_p_intf, wxWindow *_p_parent ):
-    wxWindow( _p_parent, -1 )
+  wxWindow( _p_parent, -1, wxDefaultPosition, wxDefaultSize, wxCLIP_CHILDREN )
 {
     /* Initializations */
     p_intf = _p_intf;
     p_parent = _p_parent;
+    p_child_window = 0;
 
     vlc_mutex_init( p_intf, &lock );
 
-    b_auto_size = config_GetInt( p_intf, "wx-autosize" );
+    b_auto_size = p_intf->p_sys->b_video_autosize;
 
     p_vout = NULL;
     i_creation_date = 0;
@@ -118,15 +121,18 @@ VideoWindow::VideoWindow( intf_thread_t *_p_intf, wxWindow *_p_parent ):
         SetSize( child_size );
     }
 
-    p_child_window = new wxWindow( this, -1, wxDefaultPosition, child_size );
+#ifdef __WXGTK__
+    p_child_window = new wxWindow( this, -1, wxDefaultPosition, child_size,
+                                   wxCLIP_CHILDREN );
+#endif
 
     if( !b_auto_size )
     {
         SetBackgroundColour( *wxBLACK );
-        p_child_window->SetBackgroundColour( *wxBLACK );
+        if( p_child_window ) p_child_window->SetBackgroundColour( *wxBLACK );
     }
 
-    p_child_window->Show();
+    if( p_child_window ) p_child_window->Show();
     Show();
     b_shown = VLC_TRUE;
 
@@ -148,11 +154,11 @@ VideoWindow::~VideoWindow()
         if( !p_intf->psz_switch_intf )
         {
             if( vout_Control( p_vout, VOUT_CLOSE ) != VLC_SUCCESS )
-                vout_Control( p_vout, VOUT_REPARENT );
+                vout_Control( p_vout, VOUT_REPARENT, 0 );
         }
         else
         {
-            if( vout_Control( p_vout, VOUT_REPARENT ) != VLC_SUCCESS )
+            if( vout_Control( p_vout, VOUT_REPARENT, 0 ) != VLC_SUCCESS )
                 vout_Control( p_vout, VOUT_CLOSE );
         }
     }
@@ -207,7 +213,7 @@ void *VideoWindow::GetWindow( vout_thread_t *_p_vout,
     if( p_vout )
     {
         vlc_mutex_unlock( &lock );
-        msg_Dbg( p_intf, "Video window already in use" );
+        msg_Dbg( p_intf, "video window already in use" );
         return NULL;
     }
 
@@ -333,8 +339,8 @@ int VideoWindow::ControlWindow( void *p_window, int i_query, va_list args )
             unsigned int *pi_width  = va_arg( args, unsigned int * );
             unsigned int *pi_height = va_arg( args, unsigned int * );
 
-           *pi_width = GetSize().GetWidth();
-           *pi_height = GetSize().GetHeight();
+            *pi_width = GetSize().GetWidth();
+            *pi_height = GetSize().GetHeight();
             i_ret = VLC_SUCCESS;
         }
         break;
@@ -346,10 +352,8 @@ int VideoWindow::ControlWindow( void *p_window, int i_query, va_list args )
             unsigned int i_width  = va_arg( args, unsigned int );
             unsigned int i_height = va_arg( args, unsigned int );
 
-            vlc_mutex_lock( &lock );
             if( !i_width && p_vout ) i_width = p_vout->i_window_width;
             if( !i_height && p_vout ) i_height = p_vout->i_window_height;
-            vlc_mutex_unlock( &lock );
 
             /* Update dimensions */
             wxSizeEvent event( wxSize( i_width, i_height ), UpdateSize_Event );