wayland/outputs: Implement wl_output v3

This version adds a release event, allowing clients to tell the
server that it can clean up the related wl_resource.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2692>
This commit is contained in:
Robert Mader 2022-11-10 13:09:43 +01:00
parent e43234f464
commit 1b1eed0dbd
2 changed files with 16 additions and 3 deletions

View File

@ -99,6 +99,17 @@ output_resource_destroy (struct wl_resource *res)
wayland_output->resources = g_list_remove (wayland_output->resources, res); wayland_output->resources = g_list_remove (wayland_output->resources, res);
} }
static void
meta_wl_output_release (struct wl_client *client,
struct wl_resource *resource)
{
wl_resource_destroy (resource);
}
static const struct wl_output_interface meta_wl_output_interface = {
meta_wl_output_release,
};
static enum wl_output_subpixel static enum wl_output_subpixel
cogl_subpixel_order_to_wl_output_subpixel (CoglSubpixelOrder subpixel_order) cogl_subpixel_order_to_wl_output_subpixel (CoglSubpixelOrder subpixel_order)
{ {
@ -310,8 +321,10 @@ bind_output (struct wl_client *client,
wayland_output->resources = g_list_prepend (wayland_output->resources, wayland_output->resources = g_list_prepend (wayland_output->resources,
resource); resource);
wl_resource_set_user_data (resource, wayland_output); wl_resource_set_implementation (resource,
wl_resource_set_destructor (resource, output_resource_destroy); &meta_wl_output_interface,
wayland_output,
output_resource_destroy);
#ifdef WITH_VERBOSE_MODE #ifdef WITH_VERBOSE_MODE
logical_monitor = meta_monitor_get_logical_monitor (monitor); logical_monitor = meta_monitor_get_logical_monitor (monitor);

View File

@ -39,7 +39,7 @@
#define META_WL_DATA_DEVICE_MANAGER_VERSION 3 #define META_WL_DATA_DEVICE_MANAGER_VERSION 3
#define META_XDG_WM_BASE_VERSION 4 #define META_XDG_WM_BASE_VERSION 4
#define META_WL_SEAT_VERSION 8 #define META_WL_SEAT_VERSION 8
#define META_WL_OUTPUT_VERSION 2 #define META_WL_OUTPUT_VERSION 3
#define META_XSERVER_VERSION 1 #define META_XSERVER_VERSION 1
#define META_GTK_SHELL1_VERSION 5 #define META_GTK_SHELL1_VERSION 5
#define META_WL_SUBCOMPOSITOR_VERSION 1 #define META_WL_SUBCOMPOSITOR_VERSION 1