mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-03 09:01:42 -05:00
server: Allocate server ID for when resource->object.id is 0
This commit is contained in:
parent
c7473897fc
commit
44b529f2e4
1 changed files with 8 additions and 1 deletions
|
|
@ -322,9 +322,16 @@ WL_EXPORT void
|
||||||
wl_client_add_resource(struct wl_client *client,
|
wl_client_add_resource(struct wl_client *client,
|
||||||
struct wl_resource *resource)
|
struct wl_resource *resource)
|
||||||
{
|
{
|
||||||
|
if (resource->object.id == 0)
|
||||||
|
resource->object.id =
|
||||||
|
wl_map_insert_new(&client->objects,
|
||||||
|
WL_MAP_SERVER_SIDE, resource);
|
||||||
|
else
|
||||||
|
wl_map_insert_at(&client->objects,
|
||||||
|
resource->object.id, resource);
|
||||||
|
|
||||||
resource->client = client;
|
resource->client = client;
|
||||||
wl_list_init(&resource->destroy_listener_list);
|
wl_list_init(&resource->destroy_listener_list);
|
||||||
wl_map_insert_at(&client->objects, resource->object.id, resource);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WL_EXPORT void
|
WL_EXPORT void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue