wayland: Simplify global version management
libwayland-server already checks the bounds of the bind for versioning, meaning that the value that we pass to wl_global_create is all we need.
This commit is contained in:
parent
ab53c0e943
commit
75b6e917ad
@ -508,9 +508,7 @@ bind_manager (struct wl_client *client,
|
||||
void *data, guint32 version, guint32 id)
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
|
||||
resource = wl_resource_create (client, &wl_data_device_manager_interface,
|
||||
MIN (version, META_WL_DATA_DEVICE_MANAGER_VERSION), id);
|
||||
resource = wl_resource_create (client, &wl_data_device_manager_interface, version, id);
|
||||
wl_resource_set_implementation (resource, &manager_interface, NULL, NULL);
|
||||
}
|
||||
|
||||
|
@ -102,8 +102,7 @@ bind_output (struct wl_client *client,
|
||||
struct wl_resource *resource;
|
||||
guint mode_flags;
|
||||
|
||||
resource = wl_resource_create (client, &wl_output_interface,
|
||||
MIN (META_WL_OUTPUT_VERSION, version), id);
|
||||
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);
|
||||
|
@ -84,8 +84,7 @@ bind_seat (struct wl_client *client,
|
||||
MetaWaylandSeat *seat = data;
|
||||
struct wl_resource *resource;
|
||||
|
||||
resource = wl_resource_create (client, &wl_seat_interface,
|
||||
MIN (META_WL_SEAT_VERSION, version), id);
|
||||
resource = wl_resource_create (client, &wl_seat_interface, version, id);
|
||||
wl_resource_set_implementation (resource, &seat_interface, seat, unbind_resource);
|
||||
wl_list_insert (&seat->base_resource_list, wl_resource_get_link (resource));
|
||||
|
||||
|
@ -1133,7 +1133,7 @@ bind_xdg_shell (struct wl_client *client,
|
||||
|
||||
xdg_shell = g_slice_new (XdgShell);
|
||||
|
||||
xdg_shell->resource = wl_resource_create (client, &xdg_shell_interface, META_XDG_SHELL_VERSION, id);
|
||||
xdg_shell->resource = wl_resource_create (client, &xdg_shell_interface, version, id);
|
||||
wl_resource_set_implementation (xdg_shell->resource, &meta_wayland_xdg_shell_interface, data, NULL);
|
||||
|
||||
xdg_shell->client_destroy_listener.notify = xdg_shell_handle_client_destroy;
|
||||
@ -1385,8 +1385,7 @@ bind_wl_shell (struct wl_client *client,
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
|
||||
resource = wl_resource_create (client, &wl_shell_interface,
|
||||
MIN (META_WL_SHELL_VERSION, version), id);
|
||||
resource = wl_resource_create (client, &wl_shell_interface, version, id);
|
||||
wl_resource_set_implementation (resource, &meta_wayland_wl_shell_interface, data, NULL);
|
||||
}
|
||||
|
||||
@ -1463,8 +1462,7 @@ bind_gtk_shell (struct wl_client *client,
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
|
||||
resource = wl_resource_create (client, >k_shell_interface,
|
||||
MIN (META_GTK_SHELL_VERSION, version), id);
|
||||
resource = wl_resource_create (client, >k_shell_interface, version, id);
|
||||
wl_resource_set_implementation (resource, &meta_wayland_gtk_shell_interface, data, NULL);
|
||||
|
||||
/* FIXME: ask the plugin */
|
||||
@ -1749,8 +1747,7 @@ bind_subcompositor (struct wl_client *client,
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
|
||||
resource = wl_resource_create (client, &wl_subcompositor_interface,
|
||||
MIN (META_WL_SUBCOMPOSITOR_VERSION, version), id);
|
||||
resource = wl_resource_create (client, &wl_subcompositor_interface, version, id);
|
||||
wl_resource_set_implementation (resource, &meta_wayland_subcompositor_interface, data, NULL);
|
||||
}
|
||||
|
||||
|
@ -296,8 +296,7 @@ compositor_bind (struct wl_client *client,
|
||||
MetaWaylandCompositor *compositor = data;
|
||||
struct wl_resource *resource;
|
||||
|
||||
resource = wl_resource_create (client, &wl_compositor_interface,
|
||||
MIN (META_WL_COMPOSITOR_VERSION, version), id);
|
||||
resource = wl_resource_create (client, &wl_compositor_interface, version, id);
|
||||
wl_resource_set_implementation (resource, &meta_wayland_compositor_interface, compositor, NULL);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user