Skip to content

[Wayland] Bump wl_output interface to v4 #727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions src/wayland/meta-wayland-outputs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/wayland/meta-wayland-versions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading