*
* 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.
*****************************************************************************/
/*****************************************************************************
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 :( */
* 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;
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;
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 );
}
}
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;
}
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;
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 );