mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-02-28 01:41:19 -05:00
server: Stop special casing the compositor
wl_compositor_init() was just adding the global and providing a helper bind function. Not useful enough to warrent API.
This commit is contained in:
parent
bdbd6ef80b
commit
0b7d1e86af
2 changed files with 2 additions and 39 deletions
|
|
@ -387,8 +387,7 @@ lose_keyboard_focus(struct wl_listener *listener,
|
|||
}
|
||||
|
||||
WL_EXPORT void
|
||||
wl_input_device_init(struct wl_input_device *device,
|
||||
struct wl_compositor *compositor)
|
||||
wl_input_device_init(struct wl_input_device *device)
|
||||
{
|
||||
memset(device, 0, sizeof *device);
|
||||
wl_list_init(&device->resource_list);
|
||||
|
|
@ -397,7 +396,6 @@ wl_input_device_init(struct wl_input_device *device,
|
|||
|
||||
device->x = 100;
|
||||
device->y = 100;
|
||||
device->compositor = compositor;
|
||||
}
|
||||
|
||||
static struct wl_resource *
|
||||
|
|
@ -876,32 +874,3 @@ wl_client_add_object(struct wl_client *client,
|
|||
|
||||
return resource;
|
||||
}
|
||||
|
||||
static void
|
||||
compositor_bind(struct wl_client *client,
|
||||
void *data, uint32_t version, uint32_t id)
|
||||
{
|
||||
struct wl_compositor *compositor = data;
|
||||
struct wl_resource *resource;
|
||||
|
||||
resource = wl_client_add_object(client, &wl_compositor_interface,
|
||||
compositor->interface, id, compositor);
|
||||
if (resource == NULL)
|
||||
return;
|
||||
}
|
||||
|
||||
WL_EXPORT int
|
||||
wl_compositor_init(struct wl_compositor *compositor,
|
||||
const struct wl_compositor_interface *interface,
|
||||
struct wl_display *display)
|
||||
{
|
||||
struct wl_global *global;
|
||||
|
||||
compositor->interface = interface;
|
||||
global = wl_display_add_global(display, &wl_compositor_interface,
|
||||
compositor, compositor_bind);
|
||||
if (!global)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue