Commit cfcad645 authored by Erwan Tulou's avatar Erwan Tulou

skins2(Linux): support clean exit when user closes vlc via the taskbar

if not managed, vlc terminates with a "vlc: Fatal IO error: client killed"
parent c5154680
......@@ -209,6 +209,10 @@ X11Display::X11Display( intf_thread_t *pIntf ): SkinObject( pIntf ),
m_mainWindow = XCreateWindow( m_pDisplay, root, 0, 0, 1, 1, 0, 0,
InputOutput, CopyFromParent, 0, &attr );
// Receive WM_DELETE_WINDOW
Atom wm_delete = XInternAtom( m_pDisplay, "WM_DELETE_WINDOW", False);
XSetWMProtocols( m_pDisplay, m_mainWindow, &wm_delete, 1);
// Changing decorations
struct {
unsigned long flags;
......
......@@ -180,6 +180,20 @@ void X11Loop::handleX11Event()
// pTheme->getWindowManager().synchVisibility();
}
}
if( event.type == ClientMessage )
{
Atom wm_protocols =
XInternAtom( XDISPLAY, "WM_PROTOCOLS", False);
Atom wm_delete =
XInternAtom( XDISPLAY, "WM_DELETE_WINDOW", False);
if( event.xclient.message_type == wm_protocols &&
event.xclient.data.l[0] == wm_delete )
{
msg_Dbg( getIntf(), "Received WM_DELETE_WINDOW message" );
libvlc_Quit( getIntf()->p_libvlc );
}
}
return;
}
......
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