Commit cf6df794 authored by Erwan Tulou's avatar Erwan Tulou Committed by Rémi Denis-Courmont

X11: make sure base window is really destroyed...

...before calling release function of the window provider
(only way to prevent possible BadWindow xlib error)
Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent 19774722
...@@ -1863,6 +1863,20 @@ static void DestroyWindow( vout_thread_t *p_vout, x11_window_t *p_win ) ...@@ -1863,6 +1863,20 @@ static void DestroyWindow( vout_thread_t *p_vout, x11_window_t *p_win )
XUnmapWindow( p_vout->p_sys->p_display, p_win->base_window ); XUnmapWindow( p_vout->p_sys->p_display, p_win->base_window );
XDestroyWindow( p_vout->p_sys->p_display, p_win->base_window ); XDestroyWindow( p_vout->p_sys->p_display, p_win->base_window );
/* make sure base window is destroyed before proceeding further */
bool b_destroy_notify = false;
do
{
XEvent xevent;
XWindowEvent( p_vout->p_sys->p_display, p_win->base_window,
SubstructureNotifyMask | StructureNotifyMask, &xevent);
if( (xevent.type == DestroyNotify)
&& (xevent.xmap.window == p_win->base_window) )
{
b_destroy_notify = true;
}
} while( !b_destroy_notify );
vout_ReleaseWindow( p_win->owner_window ); vout_ReleaseWindow( p_win->owner_window );
} }
......
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