Commit 6bf0c3d1 authored by Cyril Deguet's avatar Cyril Deguet
Browse files

* x11/x11_window.cpp: reset the "drawable" variable to 0 before the vout child

    window is destroyed (it is not enough i guess...)
  * utils/var_text.cpp: unregister the observer to the Stream variable
    in the destructor ! (fix a crash when changing skin)
parent 39491099
......@@ -45,6 +45,7 @@ VarText::~VarText()
VlcProc *pVlcProc = VlcProc::instance( getIntf() );
pVlcProc->getTimeVar().delObserver( this );
pVlcProc->getVolumeVar().delObserver( this );
pVlcProc->getStreamVar().delObserver( this );
VarManager *pVarManager = VarManager::instance( getIntf() );
pVarManager->getHelpText().delObserver( this );
}
......
......@@ -37,7 +37,8 @@
X11Window::X11Window( intf_thread_t *pIntf, GenericWindow &rWindow,
X11Display &rDisplay, bool dragDrop, bool playOnDrop,
X11Window *pParentWindow ):
OSWindow( pIntf ), m_rDisplay( rDisplay ), m_dragDrop( dragDrop )
OSWindow( pIntf ), m_rDisplay( rDisplay ), m_pParent( pParentWindow ),
m_dragDrop( dragDrop )
{
Window parent;
if (pParentWindow)
......@@ -108,7 +109,7 @@ X11Window::X11Window( intf_thread_t *pIntf, GenericWindow &rWindow,
XSetTransientForHint( XDISPLAY, m_wnd, m_rDisplay.getMainWindow() );
// XXX Kludge to tell VLC that this window is the vout
if (pParentWindow)
if( m_pParent )
{
vlc_value_t value;
value.i_int = (int) (ptrdiff_t) (void *) m_wnd;
......@@ -119,6 +120,14 @@ X11Window::X11Window( intf_thread_t *pIntf, GenericWindow &rWindow,
X11Window::~X11Window()
{
// XXX Kludge to tell VLC that this window is no more the vout
if( m_pParent )
{
vlc_value_t value;
value.i_int = 0;
var_Set( getIntf()->p_vlc, "drawable", value );
}
X11Factory *pFactory = (X11Factory*)X11Factory::instance( getIntf() );
pFactory->m_windowMap[m_wnd] = NULL;
pFactory->m_dndMap[m_wnd] = NULL;
......
......@@ -70,6 +70,8 @@ class X11Window: public OSWindow
X11Display &m_rDisplay;
/// Window ID
Window m_wnd;
/// Parent window
X11Window *m_pParent;
/// Indicates whether the window handles drag&drop events
bool m_dragDrop;
/// Drop target
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment