From 808e7127673ffc03815709e7dba9d0b7e2cbe8ac Mon Sep 17 00:00:00 2001 From: Niels De Graef Date: Fri, 14 Dec 2018 14:28:26 +0100 Subject: [PATCH] gl/wayland: prefix shell(_surface) with wl_ This will help us make the distinction later with xdg-shell and other possible protocols that need to be supported. --- .../gst/gl/wayland/gstgldisplay_wayland.c | 5 ++- .../gst/gl/wayland/gstgldisplay_wayland.h | 2 +- .../gst/gl/wayland/gstglwindow_wayland_egl.c | 38 +++++++++---------- .../gst/gl/wayland/gstglwindow_wayland_egl.h | 2 +- 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/gst-libs/gst/gl/wayland/gstgldisplay_wayland.c b/gst-libs/gst/gl/wayland/gstgldisplay_wayland.c index f8c573479c..cdad132648 100644 --- a/gst-libs/gst/gl/wayland/gstgldisplay_wayland.c +++ b/gst-libs/gst/gl/wayland/gstgldisplay_wayland.c @@ -51,7 +51,8 @@ registry_handle_global (void *data, struct wl_registry *registry, display->subcompositor = wl_registry_bind (registry, name, &wl_subcompositor_interface, 1); } else if (g_strcmp0 (interface, "wl_shell") == 0) { - display->shell = wl_registry_bind (registry, name, &wl_shell_interface, 1); + display->wl_shell = + wl_registry_bind (registry, name, &wl_shell_interface, 1); } } @@ -91,7 +92,7 @@ gst_gl_display_wayland_finalize (GObject * object) { GstGLDisplayWayland *display_wayland = GST_GL_DISPLAY_WAYLAND (object); - g_clear_pointer (&display_wayland->shell, wl_shell_destroy); + g_clear_pointer (&display_wayland->wl_shell, wl_shell_destroy); /* Cause eglTerminate() to occur before wl_display_disconnect() * https://bugzilla.gnome.org/show_bug.cgi?id=787293 */ diff --git a/gst-libs/gst/gl/wayland/gstgldisplay_wayland.h b/gst-libs/gst/gl/wayland/gstgldisplay_wayland.h index 1ba66551a7..7b91baa06f 100644 --- a/gst-libs/gst/gl/wayland/gstgldisplay_wayland.h +++ b/gst-libs/gst/gl/wayland/gstgldisplay_wayland.h @@ -56,7 +56,7 @@ struct _GstGLDisplayWayland struct wl_registry *registry; struct wl_compositor *compositor; struct wl_subcompositor *subcompositor; - struct wl_shell *shell; + struct wl_shell *wl_shell; /* */ gboolean foreign_display; diff --git a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c index 50d249f37e..120877e918 100644 --- a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c +++ b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c @@ -140,11 +140,11 @@ pointer_handle_button (void *data, struct wl_pointer *pointer, uint32_t serial, window_egl->display.serial = serial; if (button == BTN_LEFT && state_w == WL_POINTER_BUTTON_STATE_PRESSED) - wl_shell_surface_move (window_egl->window.shell_surface, + wl_shell_surface_move (window_egl->window.wl_shell_surface, window_egl->display.seat, serial); if (button == BTN_RIGHT && state_w == WL_POINTER_BUTTON_STATE_PRESSED) - wl_shell_surface_resize (window_egl->window.shell_surface, + wl_shell_surface_resize (window_egl->window.wl_shell_surface, window_egl->display.seat, serial, edges); } @@ -194,37 +194,37 @@ static const struct wl_seat_listener seat_listener = { }; #endif static void -handle_ping (void *data, struct wl_shell_surface *shell_surface, +handle_ping (void *data, struct wl_shell_surface *wl_shell_surface, uint32_t serial) { GstGLWindowWaylandEGL *window_egl = data; GST_TRACE_OBJECT (window_egl, "ping received serial %u", serial); - wl_shell_surface_pong (shell_surface, serial); + wl_shell_surface_pong (wl_shell_surface, serial); } static void window_resize (GstGLWindowWaylandEGL * window_egl, guint width, guint height); static void -handle_configure (void *data, struct wl_shell_surface *shell_surface, +handle_configure (void *data, struct wl_shell_surface *wl_shell_surface, uint32_t edges, int32_t width, int32_t height) { GstGLWindowWaylandEGL *window_egl = data; - GST_DEBUG ("configure event on surface %p, %ix%i", shell_surface, width, + GST_DEBUG ("configure event on surface %p, %ix%i", wl_shell_surface, width, height); window_resize (window_egl, width, height); } static void -handle_popup_done (void *data, struct wl_shell_surface *shell_surface) +handle_popup_done (void *data, struct wl_shell_surface *wl_shell_surface) { } -static const struct wl_shell_surface_listener shell_surface_listener = { +static const struct wl_shell_surface_listener wl_shell_surface_listener = { handle_ping, handle_configure, handle_popup_done @@ -237,9 +237,9 @@ destroy_surfaces (GstGLWindowWaylandEGL * window_egl) wl_subsurface_destroy (window_egl->window.subsurface); window_egl->window.subsurface = NULL; } - if (window_egl->window.shell_surface) { - wl_shell_surface_destroy (window_egl->window.shell_surface); - window_egl->window.shell_surface = NULL; + if (window_egl->window.wl_shell_surface) { + wl_shell_surface_destroy (window_egl->window.wl_shell_surface); + window_egl->window.wl_shell_surface = NULL; } if (window_egl->window.surface) { wl_surface_destroy (window_egl->window.surface); @@ -289,20 +289,20 @@ create_surfaces (GstGLWindowWaylandEGL * window_egl) } } else { shell_window: - if (!window_egl->window.shell_surface) { - window_egl->window.shell_surface = - wl_shell_get_shell_surface (display->shell, + 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.shell_surface, window_egl->window.queue); + window.wl_shell_surface, window_egl->window.queue); - wl_shell_surface_add_listener (window_egl->window.shell_surface, - &shell_surface_listener, window_egl); + 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.shell_surface, + wl_shell_surface_set_title (window_egl->window.wl_shell_surface, "OpenGL Renderer"); - wl_shell_surface_set_toplevel (window_egl->window.shell_surface); + wl_shell_surface_set_toplevel (window_egl->window.wl_shell_surface); } } diff --git a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.h b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.h index 803ff54a97..f1e98295aa 100644 --- a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.h +++ b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.h @@ -65,7 +65,7 @@ struct window { struct wl_event_queue *queue; struct wl_surface *surface; - struct wl_shell_surface *shell_surface; + struct wl_shell_surface *wl_shell_surface; struct wl_egl_window *native; struct wl_surface *foreign_surface; struct wl_subsurface *subsurface;