diff options
author | Robert Mader <robert.mader@posteo.de> | 2022-11-10 13:09:43 +0100 |
---|---|---|
committer | Robert Mader <robert.mader@posteo.de> | 2022-12-03 09:37:38 +0000 |
commit | c0cbc240e0e81e3bd62deec0ef4ca6e35b1f8bee (patch) | |
tree | 38f8681b31e06313e119531fb7a79f6fa57ec951 | |
parent | ff15d05f8be58825cdb7aee044d43e69625579e0 (diff) | |
download | mutter-c0cbc240e0e81e3bd62deec0ef4ca6e35b1f8bee.tar.gz |
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>
(cherry picked from commit 1b1eed0dbdbb8fdac59a2ffa66505f7d8ed9f99e)
-rw-r--r-- | src/wayland/meta-wayland-outputs.c | 17 | ||||
-rw-r--r-- | src/wayland/meta-wayland-versions.h | 2 |
2 files changed, 16 insertions, 3 deletions
diff --git a/src/wayland/meta-wayland-outputs.c b/src/wayland/meta-wayland-outputs.c index 6c8baa0df..c6bb857d5 100644 --- a/src/wayland/meta-wayland-outputs.c +++ b/src/wayland/meta-wayland-outputs.c @@ -98,6 +98,17 @@ output_resource_destroy (struct wl_resource *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 cogl_subpixel_order_to_wl_output_subpixel (CoglSubpixelOrder subpixel_order) { @@ -319,8 +330,10 @@ bind_output (struct wl_client *client, wayland_output->resources = g_list_prepend (wayland_output->resources, resource); - wl_resource_set_user_data (resource, wayland_output); - wl_resource_set_destructor (resource, output_resource_destroy); + wl_resource_set_implementation (resource, + &meta_wl_output_interface, + wayland_output, + output_resource_destroy); #ifdef WITH_VERBOSE_MODE logical_monitor = meta_monitor_get_logical_monitor (monitor); diff --git a/src/wayland/meta-wayland-versions.h b/src/wayland/meta-wayland-versions.h index 8ffb5d9ef..3a19c3832 100644 --- a/src/wayland/meta-wayland-versions.h +++ b/src/wayland/meta-wayland-versions.h @@ -40,7 +40,7 @@ #define META_XDG_WM_BASE_VERSION 4 #define META_ZXDG_SHELL_V6_VERSION 1 #define META_WL_SEAT_VERSION 5 -#define META_WL_OUTPUT_VERSION 2 +#define META_WL_OUTPUT_VERSION 3 #define META_XSERVER_VERSION 1 #define META_GTK_SHELL1_VERSION 5 #define META_WL_SUBCOMPOSITOR_VERSION 1 |