diff --git a/src/wayland/meta-wayland-outputs.c b/src/wayland/meta-wayland-outputs.c index 64de5abc3..b75434256 100644 --- a/src/wayland/meta-wayland-outputs.c +++ b/src/wayland/meta-wayland-outputs.c @@ -68,6 +68,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 MetaMonitor * pick_main_monitor (MetaLogicalMonitor *logical_monitor) { @@ -293,6 +304,25 @@ send_output_events (struct wl_resource *resource, } } + if (need_all_events && version >= WL_OUTPUT_NAME_SINCE_VERSION) + { + const char *name; + + name = meta_monitor_get_connector (monitor); + wl_output_send_name (resource, name); + need_done = TRUE; + } + + if (need_all_events && version >= WL_OUTPUT_DESCRIPTION_SINCE_VERSION) + { + const char *description; + + description = meta_monitor_get_display_name (monitor); + wl_output_send_description (resource, description); + need_done = TRUE; + } + + if (need_all_events && version >= WL_OUTPUT_DONE_SINCE_VERSION) { wl_output_send_done (resource); @@ -319,8 +349,10 @@ bind_output (struct wl_client *client, resource = wl_resource_create (client, &wl_output_interface, version, id); 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); if (!logical_monitor) return; diff --git a/src/wayland/meta-wayland-versions.h b/src/wayland/meta-wayland-versions.h index 2d6ce5ace..682ceb9b6 100644 --- a/src/wayland/meta-wayland-versions.h +++ b/src/wayland/meta-wayland-versions.h @@ -41,7 +41,7 @@ #define META_ZXDG_SHELL_V6_VERSION 1 #define META_WL_SHELL_VERSION 1 #define META_WL_SEAT_VERSION 5 -#define META_WL_OUTPUT_VERSION 2 +#define META_WL_OUTPUT_VERSION 4 #define META_XSERVER_VERSION 1 #define META_GTK_SHELL1_VERSION 3 #define META_WL_SUBCOMPOSITOR_VERSION 1