From b56bf26dcec5db8592793c995914efbea56cb86d Mon Sep 17 00:00:00 2001 From: Julien Isorce Date: Fri, 16 Aug 2013 16:29:12 +0100 Subject: [PATCH] [791/906] glwindow/x11: remove X11EventSource as soon as the window is deleted gst_gl_window_x11_send_message do not use XSendEvent anymore --- gst-libs/gst/gl/x11/gstglwindow_x11.c | 7 ++++++- gst-libs/gst/gl/x11/x11_event_source.c | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/gst-libs/gst/gl/x11/gstglwindow_x11.c b/gst-libs/gst/gl/x11/gstglwindow_x11.c index a4f8a2c971..cf5d241a4d 100644 --- a/gst-libs/gst/gl/x11/gstglwindow_x11.c +++ b/gst-libs/gst/gl/x11/gstglwindow_x11.c @@ -634,12 +634,14 @@ gst_gl_window_x11_run (GstGLWindow * window) g_main_loop_run (window_x11->loop); } -void +gboolean gst_gl_window_x11_handle_event (GstGLWindowX11 * window_x11) { GstGLWindow *window; GstGLWindowX11Class *window_class; + gboolean ret = TRUE; + window = GST_GL_WINDOW (window_x11); window_class = GST_GL_WINDOW_X11_GET_CLASS (window_x11); @@ -667,6 +669,8 @@ gst_gl_window_x11_handle_event (GstGLWindowX11 * window_x11) if (window->close) window->close (window->close_data); + + ret = FALSE; } break; } @@ -721,6 +725,7 @@ gst_gl_window_x11_handle_event (GstGLWindowX11 * window_x11) } // switch } // while running + return ret; } /* Not called by the gl thread */ diff --git a/gst-libs/gst/gl/x11/x11_event_source.c b/gst-libs/gst/gl/x11/x11_event_source.c index f594383098..0d83776a83 100644 --- a/gst-libs/gst/gl/x11/x11_event_source.c +++ b/gst-libs/gst/gl/x11/x11_event_source.c @@ -27,7 +27,7 @@ #include "x11_event_source.h" -extern void gst_gl_window_x11_handle_event (GstGLWindowX11 * window_x11); +extern gboolean gst_gl_window_x11_handle_event (GstGLWindowX11 * window_x11); typedef struct _X11EventSource { @@ -66,12 +66,12 @@ x11_event_source_dispatch (GSource * base, GSourceFunc callback, gpointer data) { X11EventSource *source = (X11EventSource *) base; - gst_gl_window_x11_handle_event (source->window); + gboolean ret = gst_gl_window_x11_handle_event (source->window); if (callback) callback (data); - return TRUE; + return ret; } static GSourceFuncs x11_event_source_funcs = {