From b52cf2f7d166df944a76194e76c104455c26a7d8 Mon Sep 17 00:00:00 2001 From: Niels De Graef Date: Fri, 14 Dec 2018 14:54:24 +0100 Subject: [PATCH] gl/wayland: extract code to create wl_shell_surface This is just a cosmetic change that will make it easier to differentiate between wl_shell and xdg_wm_base later. --- .../gst/gl/wayland/gstglwindow_wayland_egl.c | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c index 120877e918..ef2ca0220d 100644 --- a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c +++ b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c @@ -248,7 +248,28 @@ destroy_surfaces (GstGLWindowWaylandEGL * window_egl) if (window_egl->window.native) { wl_egl_window_destroy (window_egl->window.native); window_egl->window.native = NULL; +} + +static struct wl_shell_surface * +create_wl_shell_surface (GstGLWindowWaylandEGL * window_egl, + GstGLDisplayWayland *display) +{ + struct wl_shell_surface *wl_shell_surface; + + wl_shell_surface = wl_shell_get_shell_surface (display->wl_shell, + window_egl->window.surface); + + if (window_egl->window.queue) { + wl_proxy_set_queue ((struct wl_proxy *) wl_shell_surface, + window_egl->window.queue); } + + wl_shell_surface_add_listener (wl_shell_surface, &wl_shell_surface_listener, + window_egl); + wl_shell_surface_set_title (wl_shell_surface, "OpenGL Renderer"); + wl_shell_surface_set_toplevel (wl_shell_surface); + + return wl_shell_surface; } static void @@ -290,19 +311,7 @@ create_surfaces (GstGLWindowWaylandEGL * window_egl) } else { shell_window: if (!window_egl->window.wl_shell_surface) { - window_egl->window.wl_shell_surface = - wl_shell_get_shell_surface (display->wl_shell, - window_egl->window.surface); - if (window_egl->window.queue) - wl_proxy_set_queue ((struct wl_proxy *) window_egl-> - window.wl_shell_surface, window_egl->window.queue); - - wl_shell_surface_add_listener (window_egl->window.wl_shell_surface, - &wl_shell_surface_listener, window_egl); - - wl_shell_surface_set_title (window_egl->window.wl_shell_surface, - "OpenGL Renderer"); - wl_shell_surface_set_toplevel (window_egl->window.wl_shell_surface); + window_egl->window.wl_shell_surface = create_wl_shell_surface (display); } }