gl/window_x11: avoid BadDrawable error on shutdown

This commit is contained in:
Matthew Waters 2014-05-27 13:04:39 +10:00 committed by Tim-Philipp Müller
parent f2bf233ce4
commit e502311ce4

View file

@ -258,9 +258,14 @@ void
gst_gl_window_x11_close (GstGLWindow * window) gst_gl_window_x11_close (GstGLWindow * window)
{ {
GstGLWindowX11 *window_x11 = GST_GL_WINDOW_X11 (window); GstGLWindowX11 *window_x11 = GST_GL_WINDOW_X11 (window);
GstGLDisplay *display = window->display;
XEvent event; XEvent event;
if (window_x11->device) { if (window_x11->device) {
/* Avoid BadDrawable Errors... */
if (gst_gl_display_get_handle_type (display) & GST_GL_DISPLAY_TYPE_X11)
XSync (GST_GL_DISPLAY_X11 (display)->display, FALSE);
if (window_x11->internal_win_id) if (window_x11->internal_win_id)
XUnmapWindow (window_x11->device, window_x11->internal_win_id); XUnmapWindow (window_x11->device, window_x11->internal_win_id);