diff --git a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c index 8db66bff24..43eca98d6d 100644 --- a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c +++ b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c @@ -234,11 +234,14 @@ static const struct wl_shell_surface_listener wl_shell_surface_listener = { static void handle_xdg_toplevel_close (void *data, struct xdg_toplevel *xdg_toplevel) { - GstGLWindowWaylandEGL *window_egl = data; + GstGLWindow *window = data; GST_DEBUG ("XDG toplevel got a \"close\" event."); - gst_gl_window_wayland_egl_close (GST_GL_WINDOW (window_egl)); + if (window->close) + window->close (window->close_data); + + gst_gl_display_remove_window (window->display, window); } static void