[vlc-devel] commit: X11: make sure base window is really destroyed... (Erwan Tulou )

git version control git at videolan.org
Sun Mar 15 19:27:09 CET 2009


vlc | branch: master | Erwan Tulou <brezhoneg1 at yahoo.fr> | Fri Mar 13 20:43:54 2009 +0100| [cf6df7947bd5e62b99788cf9862b312c5b3d5599] | committer: 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: Rémi Denis-Courmont <remi at remlab.net>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cf6df7947bd5e62b99788cf9862b312c5b3d5599
---

 modules/video_output/x11/xcommon.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/modules/video_output/x11/xcommon.c b/modules/video_output/x11/xcommon.c
index cd89701..b241025 100644
--- a/modules/video_output/x11/xcommon.c
+++ b/modules/video_output/x11/xcommon.c
@@ -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 );
     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 );
 }
 




More information about the vlc-devel mailing list